File size: 579 Bytes
5f67a1f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""Recompute scoreboard numbers from this dataset (needs cass/ package)."""
import json
import sys
sys.path.insert(0, ".")
from cass.vibe import security_scan as sec
from cass.teachers import calibration as cal
ok = se = n = 0
for line in open("data/truth20.jsonl", encoding="utf-8"):
    r = json.loads(line)
    f = sec.scan_file(r["case"] + ".py", r["code"])
    sv, p = cal.calibrated_verdict(f)
    ok += (bool(sv) == bool(r["truth"]))
    se += (p - float(r["truth"])) ** 2
    n += 1
print(f"truth20: acc {ok/n:.3f} brier {se/n:.4f} (expect 1.000 0.0368)")