Spaces:
Sleeping
Sleeping
Update src/saving_utils.py
Browse files- src/saving_utils.py +4 -4
src/saving_utils.py
CHANGED
|
@@ -40,24 +40,24 @@ def save_similarity_output(output_dict, method_name, leaderboard_path="./data/le
|
|
| 40 |
if correlation_key in output_dict:
|
| 41 |
correlation_values.append(output_dict[correlation_key])
|
| 42 |
similarity_df.at[similarity_df['Method'] == method_name, f"{dataset}_{aspect}_correlation"] = output_dict[correlation_key]
|
| 43 |
-
leaderboard_df.at[
|
| 44 |
|
| 45 |
# Process pvalue if present
|
| 46 |
if pvalue_key in output_dict:
|
| 47 |
pvalue_values.append(output_dict[pvalue_key])
|
| 48 |
similarity_df.at[similarity_df['Method'] == method_name, f"{dataset}_{aspect}_pvalue"] = output_dict[pvalue_key]
|
| 49 |
-
leaderboard_df.at[
|
| 50 |
|
| 51 |
# Calculate averages if all three aspects (MF, BP, CC) are present
|
| 52 |
if len(correlation_values) == 3:
|
| 53 |
averages[f"{dataset}_Ave_correlation"] = sum(correlation_values) / 3
|
| 54 |
similarity_df.at[similarity_df['Method'] == method_name, f"{dataset}_Ave_correlation"] = averages[f"{dataset}_Ave_correlation"]
|
| 55 |
-
leaderboard_df.at[
|
| 56 |
|
| 57 |
if len(pvalue_values) == 3:
|
| 58 |
averages[f"{dataset}_Ave_pvalue"] = sum(pvalue_values) / 3
|
| 59 |
similarity_df.at[similarity_df['Method'] == method_name, f"{dataset}_Ave_pvalue"] = averages[f"{dataset}_Ave_pvalue"]
|
| 60 |
-
leaderboard_df.at[
|
| 61 |
|
| 62 |
# Save the updated DataFrames back to CSV
|
| 63 |
leaderboard_df.to_csv(leaderboard_path, index=False)
|
|
|
|
| 40 |
if correlation_key in output_dict:
|
| 41 |
correlation_values.append(output_dict[correlation_key])
|
| 42 |
similarity_df.at[similarity_df['Method'] == method_name, f"{dataset}_{aspect}_correlation"] = output_dict[correlation_key]
|
| 43 |
+
leaderboard_df.at[leaderboard_df['Method'] == method_name, f"sim_{dataset}_{aspect}_correlation"] = output_dict[correlation_key]
|
| 44 |
|
| 45 |
# Process pvalue if present
|
| 46 |
if pvalue_key in output_dict:
|
| 47 |
pvalue_values.append(output_dict[pvalue_key])
|
| 48 |
similarity_df.at[similarity_df['Method'] == method_name, f"{dataset}_{aspect}_pvalue"] = output_dict[pvalue_key]
|
| 49 |
+
leaderboard_df.at[leaderboard_df['Method'] == method_name, f"sim_{dataset}_{aspect}_pvalue"] = output_dict[pvalue_key]
|
| 50 |
|
| 51 |
# Calculate averages if all three aspects (MF, BP, CC) are present
|
| 52 |
if len(correlation_values) == 3:
|
| 53 |
averages[f"{dataset}_Ave_correlation"] = sum(correlation_values) / 3
|
| 54 |
similarity_df.at[similarity_df['Method'] == method_name, f"{dataset}_Ave_correlation"] = averages[f"{dataset}_Ave_correlation"]
|
| 55 |
+
leaderboard_df.at[leaderboard_df['Method'] == method_name, f"sim_{dataset}_Ave_correlation"] = averages[f"{dataset}_Ave_correlation"]
|
| 56 |
|
| 57 |
if len(pvalue_values) == 3:
|
| 58 |
averages[f"{dataset}_Ave_pvalue"] = sum(pvalue_values) / 3
|
| 59 |
similarity_df.at[similarity_df['Method'] == method_name, f"{dataset}_Ave_pvalue"] = averages[f"{dataset}_Ave_pvalue"]
|
| 60 |
+
leaderboard_df.at[leaderboard_df['Method'] == method_name, f"sim_{dataset}_Ave_pvalue"] = averages[f"{dataset}_Ave_pvalue"]
|
| 61 |
|
| 62 |
# Save the updated DataFrames back to CSV
|
| 63 |
leaderboard_df.to_csv(leaderboard_path, index=False)
|