fix(report): choose the cascade threshold on one half and score it on the other - #81
Merged
Merged
Conversation
… the other The cascade chose its threshold and reported its coverage and cost on the same rows, so the figures were its in-sample best case. With a temperature recommended those were the eval rows; with none, every row, while the text still said "held-out". The 200-row minimum counted the same rows. The threshold is now chosen on the fit half and scored on the held-out half, using the recalibration split when there is one and a split made the same way when there is not. Both halves are on the recalibrated scale when a temperature was recommended, so the held-out rows are unseen by the temperature and the threshold alike. The 200-row minimum counts held-out rows. The report says where the threshold was chosen and where it was scored. PLAN says the same. Fixes #30. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.
Fixes #30.
The problem. The cascade chose its threshold and reported its coverage and cost on the same rows, so the printed figures were its in-sample best case. With a temperature recommended those rows were the eval split. With none, it was every row, while the text still said "held-out". On 300 synthetic rows with recalibration refused, it printed
threshold 0.943 ... over 300 rows, covered accuracy 1.000.What changed
make_split, same fraction and seed) when there is not.Checked
mainand pass now:ruff,mypy --strict, the fullpytestsuite, and the site build all pass. The example report supplies no costs, so it is unchanged.🤖 Generated with Claude Code