Skip to content

Commit ba35569

Browse files
Fix dynamic metric aggregation for unnamed index (#381)
1 parent 118f193 commit ba35569

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

cybench/runs/run_benchmark.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,12 +388,9 @@ def run_benchmark_on_all_data():
388388
run_name=run_name, dataset_name=dataset_name, sel_years=sel_years
389389
)
390390

391+
index_cols = results["df_metrics"].index.names
391392
df_metrics = results["df_metrics"].reset_index()
392-
393-
# Identify index columns dynamically
394-
index_cols = df_metrics.columns[:len(df_metrics.index.names)]
395393
metric_cols = [c for c in df_metrics.columns if c not in index_cols]
396-
397394
# Group and average all available metrics
398395
agg_df = df_metrics.groupby("model")[metric_cols].mean().round(3)
399396
print(agg_df)

0 commit comments

Comments
 (0)