Skip to content

Commit 9a9b3a4

Browse files
dashboard
1 parent 80fc007 commit 9a9b3a4

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

cybench/runs/analysis/model_family_radar_lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ def _records_from_medians(
282282
raw_row = medians.loc[model_key]
283283
raw: dict[str, float | None] = {}
284284
iqr: dict[str, dict[str, float | None]] = {}
285-
for col in RAW_TABLE_METRICS:
285+
for col in VIEW_METRICS:
286286
if col not in raw_row.index:
287287
continue
288288
val = raw_row.get(col)

tests/runs/test_model_family_radar.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,18 @@ def test_build_radar_html_embeds_payload(tmp_path: Path):
383383
assert "booktabs" in html
384384

385385

386+
def test_build_radar_slice_includes_r2_in_family_raw():
387+
df = pd.DataFrame(
388+
[
389+
_summary_row("xgboost", country="DE", crop="maize", nrmse=0.2, r2=0.51),
390+
_summary_row("xgboost", country="US", crop="maize", nrmse=0.22, r2=0.48),
391+
]
392+
)
393+
sl = build_radar_slice(df, batch_horizon="eos", crop="maize")
394+
xgb = next(f for f in sl["families"] if f["model"] == "xgboost")
395+
assert xgb["raw"]["r2"] == pytest.approx(0.495, abs=0.01)
396+
397+
386398
def test_build_paper_family_table_latex_includes_r2():
387399
rows = []
388400
for crop, country, model, nrmse, r2 in [

0 commit comments

Comments
 (0)