Datasets:
4.0.2: pass_1_mean skips missing values instead of crashing
Browse files- caibench_dynamics.py +3 -2
caibench_dynamics.py
CHANGED
|
@@ -985,8 +985,9 @@ def score(rows, samples_pred):
|
|
| 985 |
pk[k] = None # these compare the model with itself, so they are reported per sample only
|
| 986 |
out["pass_k"] = pk
|
| 987 |
out["k"] = len(per_sample)
|
| 988 |
-
|
| 989 |
-
|
|
|
|
| 990 |
else:
|
| 991 |
out["by_level"] = {}
|
| 992 |
for L in sorted({r["level"] for r in rows}):
|
|
|
|
| 985 |
pk[k] = None # these compare the model with itself, so they are reported per sample only
|
| 986 |
out["pass_k"] = pk
|
| 987 |
out["k"] = len(per_sample)
|
| 988 |
+
vals = {k: [x for x in ((m[k]["score"] if isinstance(m[k], dict) else m[k]) for m in per_sample) if x is not None]
|
| 989 |
+
for k in HEADLINE}
|
| 990 |
+
out["pass_1_mean"] = {k: round(sum(v) / len(v), 4) if v else None for k, v in vals.items()}
|
| 991 |
else:
|
| 992 |
out["by_level"] = {}
|
| 993 |
for L in sorted({r["level"] for r in rows}):
|