MCPcopy Create free account
hub / github.com/MuLabPKU/TransArch / pick_metric

Function pick_metric

GQLA_preprint/scripts/summarize_lm_eval.py:25–34  ·  view source on GitHub ↗

Return (metric_name, value, stderr) preferring acc_norm over acc.

(row: dict)

Source from the content-addressed store, hash-verified

23
24
25def pick_metric(row: dict) -> tuple[str, float, float | None]:
26 """Return (metric_name, value, stderr) preferring acc_norm over acc."""
27 keys = {k.split(",")[0]: float(v) for k, v in row.items()
28 if isinstance(v, (int, float))}
29 for m in METRIC_PRIORITY:
30 if m in keys:
31 return m, keys[m], keys.get(f"{m}_stderr")
32 # fallback: first numeric key
33 k, v = next(iter(keys.items()))
34 return k, v, None
35
36
37def main():

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected