Compare policies on held-out scenarios
Pair rollout results by scenario and keep infrastructure failures visible.
Your task
A report currently counts every success in a candidate log, including training scenarios. Input contains heldout, a list of unique scenario IDs, and baseline and candidate, objects mapping scenario ID to success, failure, or infra_error. A missing entry is also unavailable. Compare only the IDs in heldout and only when both policies returned success or failure.
Return matched, baseline_successes, candidate_successes, and unavailable. Count each held-out scenario once. An unavailable pair increments unavailable once, even when both policies failed to produce a verdict. Successful rollouts in an unavailable pair do not count.
Expected behavior
Compare outcomes over the same valid scenario pairs and report how many held-out comparisons were unavailable.
Examples
{"heldout":["a","b"],"baseline":{"b":"failure","a":"success"},"candidate":{"a":"failure","b":"success","train":"success"}}{"matched":2,"baseline_successes":1,"candidate_successes":1,"unavailable":0}{"heldout":["a"],"baseline":{"a":"success"},"candidate":{"a":"infra_error"}}{"matched":0,"baseline_successes":0,"candidate_successes":0,"unavailable":1}{"heldout":[],"baseline":{},"candidate":{}}{"matched":0,"baseline_successes":0,"candidate_successes":0,"unavailable":0}Before you begin
- Python functions, lists, and dictionaries
Need a nudge?
Reveal one investigation hint at a time. Try each clue before opening the next.
Read the report, then sign in to start your investigation.