Surface the per-bin calibration gap; tidy report construction - #22
Merged
Conversation
Follow-ups from a review of the copilot-calibration code (#21): - the reliability diagram now shows each bin's calibration gap (predicted minus observed) in render(), to_markdown() and the CLI table — it is the most informative number per bin and CalibrationBin.gap already computed it but nothing displayed it. - _score now builds the CalibrationReport in one place: n_games / n_players are threaded in rather than patched onto the object by the caller. - evaluate_copilot's docstring notes that calibration is measured against games played by agent_factory, so results depend on the agents used. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three follow-ups from the code review of #21 (copilot calibration). No behaviour
change to the metrics — purely surfacing and tidying.
CalibrationBin.gap(predicted minusobserved) was computed and tested but never displayed. The reliability diagram
now shows it in
render(),to_markdown()and the CLI table — it is the mostinformative number per bin (it is the calibration error, by bin).
_score()now takesn_games/n_playersand returns a completeCalibrationReport, instead of the callerpatching two fields onto the object afterwards.
evaluate_copilot's docstring now states that calibration ismeasured against games played by
agent_factory, so results depend on theagents used.
Checklist
ruff/mypy/pytest(83 tests) all pass