Skip to content

Commit 5d81ec7

Browse files
committed
update ans
1 parent 2d18eae commit 5d81ec7

8 files changed

+1119
-11013
lines changed

examples/atlas/get_result_web.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def get_best_method(urls, metric_col="test_acc"):
171171
all_best_run = None
172172
all_best_step_name = None
173173
step_names = ["step2", "step3_0", "step3_1", "step3_2"]
174-
174+
step2_best_run = None
175175
# Track run statistics
176176
run_states = {"all_total_runs": 0, "all_finished_runs": 0}
177177

@@ -208,11 +208,14 @@ def get_best_method(urls, metric_col="test_acc"):
208208
elif all_best_run.summary[metric_col] > best_run.summary[metric_col] and goal == "minimize":
209209
all_best_run = best_run
210210
all_best_step_name = step_name
211+
if step2_best_run is None and step_name == "step2":
212+
step2_best_run = best_run
211213
num = run_states["all_finished_runs"] / run_states["all_total_runs"]
212214
run_states["finished_rate"] = f"{num:.2%}"
213215
need_to_check = num < 0.6
214216
runs_states_str = "|".join([f"{k}:{v}" for k, v in run_states.items()])
215-
return all_best_step_name, all_best_run, all_best_run.summary[metric_col], runs_states_str, need_to_check
217+
return all_best_step_name, all_best_run, all_best_run.summary[
218+
metric_col], runs_states_str, need_to_check, step2_best_run, step2_best_run.summary[metric_col]
216219

217220

218221
def get_best_yaml(step_name, best_run, file_path):
@@ -316,15 +319,19 @@ def get_new_ans(tissue):
316319
step3_urls.append(get_sweep_url(pd.read_csv(file_csv)))
317320
step3_str = ",".join(step3_urls)
318321
step_str = f"step2:{step2_url}|step3:{step3_str}"
319-
step_name, best_run, best_res, run_stats_str, need_to_check = get_best_method([step2_url] + step3_urls)
322+
step_name, best_run, best_res, run_stats_str, need_to_check, step2_best_run, step2_best_res = get_best_method(
323+
[step2_url] + step3_urls)
320324
best_yaml = get_best_yaml(step_name, best_run, file_path)
325+
step2_best_yaml = get_best_yaml("step2", step2_best_run, file_path)
321326
ans.append({
322327
"Dataset_id": dataset_id,
323328
method_folder: step_str,
324329
f"{method_folder}_best_yaml": best_yaml,
325330
f"{method_folder}_best_res": best_res,
326331
f"{method_folder}_run_stats": run_stats_str,
327-
f"{method_folder}_check": need_to_check
332+
f"{method_folder}_check": need_to_check,
333+
f"{method_folder}_step2_best_yaml": step2_best_yaml,
334+
f"{method_folder}_step2_best_res": step2_best_res
328335
})
329336
# with open('temp_ans.json', 'w') as f:
330337
# json.dump(ans, f,indent=4)

examples/atlas/sweep_results/Blood_ans.csv

+34-2,349
Large diffs are not rendered by default.

examples/atlas/sweep_results/Brain_ans.csv

+354-1,965
Large diffs are not rendered by default.

examples/atlas/sweep_results/Heart_ans.csv

+216-1,890
Large diffs are not rendered by default.

examples/atlas/sweep_results/Intestine_ans.csv

+66-366
Large diffs are not rendered by default.

examples/atlas/sweep_results/Kidney_ans.csv

+286-1,352
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)