diff --git a/rdagent/components/coder/data_science/pipeline/eval.py b/rdagent/components/coder/data_science/pipeline/eval.py index 9521fd10..fa28efd2 100644 --- a/rdagent/components/coder/data_science/pipeline/eval.py +++ b/rdagent/components/coder/data_science/pipeline/eval.py @@ -71,11 +71,14 @@ class PipelineCoSTEEREvaluator(CoSTEEREvaluator): model_set_in_scores = set(score_df.index) # Check model names (index) - if "ensemble" not in model_set_in_scores: - score_check_text += ( - f"\n[Error] The score dataframe doesn't contain the ensemble model.\nscore_df is:\n{score_df}" - ) + if not score_df.index.is_unique: + score_check_text += "\n[Error] The score dataframe contains duplicate model names." score_ret_code = 1 + if "ensemble" not in model_set_in_scores: + score_check_text += "\n[Error] The score dataframe doesn't contain the ensemble model." + score_ret_code = 1 + if score_ret_code != 0: + score_check_text += f"The score_df is:\n{score_df}" # Check metric name (columns) if score_df.columns.tolist() != [self.scen.metric_name]: diff --git a/rdagent/log/ui/ds_trace.py b/rdagent/log/ui/ds_trace.py index 1ec22602..b244c9c5 100644 --- a/rdagent/log/ui/ds_trace.py +++ b/rdagent/log/ui/ds_trace.py @@ -435,8 +435,8 @@ def summarize_data(): df.loc[loop, "End Time (UTC+8)"] = state.times[loop][-1].end + timedelta(hours=8) if "running" in loop_data and "no_tag" in loop_data["running"]: try: - df.loc[loop, "Running Score (valid)"] = round( - loop_data["running"]["no_tag"].result.loc["ensemble"].iloc[0], 5 + df.loc[loop, "Running Score (valid)"] = str( + round(loop_data["running"]["no_tag"].result.loc["ensemble"].iloc[0], 5) ) except: df.loc[loop, "Running Score (valid)"] = "❌" diff --git a/rdagent/scenarios/data_science/dev/runner/eval.py b/rdagent/scenarios/data_science/dev/runner/eval.py index 140fdb0c..c6503701 100644 --- a/rdagent/scenarios/data_science/dev/runner/eval.py +++ b/rdagent/scenarios/data_science/dev/runner/eval.py @@ -67,9 +67,14 @@ class DSCoSTEERCoSTEEREvaluator(CoSTEEREvaluator): # Check model names (index) # in Pipeline task, we only check ensemble in scores.csv if DS_RD_SETTING.coder_on_whole_pipeline: - if "ensemble" not in model_set_in_scores: - score_check_text += f"\n[Error] The score dataframe doesn't contain the ensemble model.\nscore_df is:\n{score_df}" + if not score_df.index.is_unique: + score_check_text += "\n[Error] The score dataframe contains duplicate model names." score_ret_code = 1 + if "ensemble" not in model_set_in_scores: + score_check_text += "\n[Error] The score dataframe doesn't contain the ensemble model." + score_ret_code = 1 + if score_ret_code != 0: + score_check_text += f"The score_df is:\n{score_df}" else: if model_set_in_scores != model_set_in_folder.union({"ensemble"}): score_check_text += f"\n[Error] The scores dataframe does not contain the correct model names as index.\ncorrect model names are: {model_set_in_folder.union({'ensemble'})}\nscore_df is:\n{score_df}"