Repository navigation
Conversation
…n (spec 4.5) The paired_gain_brier interval held the out-of-fold correction fixed and resampled clusters of its per-row loss difference, so it carried no variance from fitting the correction. In a clustered-logit simulation (G = 10-50 clusters of 5, true slope 0.7 or 0.5) its coverage at a nominal 0.95 was 0.74-0.93, missing almost always on the high side. `uncertainty.gain_interval: refit` re-runs the grouped K-fold cross-fit inside every cluster-bootstrap replicate and takes that replicate's gain. Fold membership inside a replicate is keyed on the original cluster id so a cluster drawn twice has both copies held out together; relabelling copies as distinct clusters leaks a copy into the train fold and biases every replicate gain upward. With original-id folds the same simulation covered at 0.90-0.97 in every cell, with lower power. The point estimate is unchanged and the default stays `fixed`, so the three frozen golden outputs are untouched apart from the new manifest field recording which interval was used. Flipping the default is a separate change that needs the goldens regenerated. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GTNTyyGWZbXyLAnT9qWWwV
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.
Requested by Precious · project thread
Before: the
paired_gain_brierinterval holds the out-of-fold correction fixed and resamples clusters of its per-row loss difference. It carries no variance from fitting the correction. In a clustered-logit simulation (10–50 clusters of 5 rows, true slope 0.7 or 0.5) its coverage at a nominal 95% was 74–93%, missing almost always on the high side.After:
cohort.yamlcan declareuncertainty.gain_interval: refit. Every cluster-bootstrap replicate then re-runs the grouped K-fold cross-fit on the resampled rows and takes that replicate's gain (ci_method = paired_cluster_bootstrap_refit). The point estimate is unchanged. In the same simulation this interval covered at 90–97% in every cell, with lower power. The manifest records which interval was used.Fold membership inside a replicate is keyed on the original cluster id, so a cluster drawn twice has both copies held out together. Relabelling copies as distinct clusters leaks a copy into the train fold and biases every replicate gain upward; a test pins the original-id behaviour.
How: a new
paired_brier_gain_refit_intervalinuncertainty.pytakes acrossfitcallable so it stays free of arecalibrateimport;evaluate.pyselects it from the spec;schema.pyadds thegain_intervalfield with defaultfixed. The three golden manifests gain the new field only; no golden number changes. Flipping the default torefitis a separate change that needs the GUSTO, PCam and IMPROVE goldens regenerated. Spec §4.5 is rewritten to describe both intervals and the simulation evidence.🤖 Generated with Claude Code
https://claude.ai/code/session_01GTNTyyGWZbXyLAnT9qWWwV
Generated by Claude Code