mixle.scorecard module¶
System-level scorecard for held-out question sets.
Named SystemScorecard (not Scorecard) to avoid colliding with
mixle.task.scorecard.Scorecard – a different, narrower comparison (one student solution vs its
teacher on a task); this one evaluates a whole System (teacher, captured cache,
degraded modes, budget, all of it) end to end.
- class SystemScorecard(quality, calibration, realized_cost, grounded_fraction, n)[source]
Bases:
objectOne evaluation of a
Systemagainst a fixed held-out question set.- Parameters:
- evaluate(system, question_set, *, scorer=None)[source]
Evaluate
systemover a fixed[(query, expected_answer), ...]set.quality– fraction of questionsscorerjudges correct (default: case-insensitive substring match ofexpectedin the reply).grounded_fraction– fraction answered WITHOUT a degraded mode (teacher or captured, not a store-only fallback / refusal / failure): the fraction of answers you can actually trust came from a real answer path, not a fault-boundary guess.realized_cost– total spend units (total_units()) across the set.calibration– a coarse proxy (currently equal toquality) untilanswercarries a real per-answer confidence to calibrate against; extend THIS function, not call sites, once that lands.
- class RegressionReport(regressed, reasons=<factory>)[source]
Bases:
objectWhether
currentis worse thanbaselineon any tracked axis, and exactly why.
- detect_regression(baseline, current, *, tolerance=1e-9)[source]
Compare two scorecards from the SAME held-out set across improve-rounds.
Never silently accepts a round that answers worse, less groundedly, or for more cost than the round before it – each tracked axis that got worse (beyond
tolerance) is named inreasons.- Parameters:
baseline (SystemScorecard)
current (SystemScorecard)
tolerance (float)
- Return type:
RegressionReport