Library / Code module
Split conformal prediction intervals
split_conformal_intervals
Turn any point predictor into prediction intervals with a finite-sample coverage guarantee, using held-out calibration residuals and the exact ceil((n + 1)(1 - alpha)) quantile index, optionally per group (Mondrian), with a seeded coverage check on held-out data.
ATTRIBUTION.md3.9 KBLICENSE1.0 KBREADME.md2.8 KBatom_cli.py3.0 KBcomponent.json9.3 KBnumerics.py28.0 KBschema_lite.py8.9 KBsplit_conformal_intervals.py6.6 KBtest_package.py12.0 KBtest_split_conformal_intervals.py3.8 KB
Full files in your harness.
What it takes and gives
- Runs with
- Python 3.10 or later
- Entry points
- conformal_quantile, split_conformal, coverage, coverage_simulation
- Known answers
- 8 cases its tests reproduce
Cases it covers
- no uncorrected quantile: The plain empirical quantile uses index ceil(n (1 - alpha)) = 9 and under-covers; the finite-sample index is ceil((n + 1)(1 - alpha)) = 10.
Limits and scope
- Limits
- Marginal coverage only: it does not guarantee coverage for each input value, and under distribution shift the guarantee is lost. Absolute residuals give symmetric intervals of constant width per group. With few calibration points the interval can be unbounded. The simulation is a seeded consistency check on one synthetic model.
- Guarantees
- P(y in interval) >= 1 - alpha marginally over calibration and test draws; below 1 - alpha + 1/(n + 1) when residuals have no ties. The index k = ceil((n + 1)(1 - alpha)) is computed exactly from the decimal value of alpha; k > n gives an unbounded interval. Mondrian intervals give the same guarantee within each group.
- Assumes
- Calibration and test points are exchangeable (for Mondrian intervals: exchangeable within each group). The predictor was fitted on data disjoint from the calibration set.
Details
- Kind
- Code module
- Licence
- MIT
- Declared effects
- runs commands
- Source
- github.com/alisonjieli-png/loop-engine/tools/creative_originals/evaluation_atoms/items/split_conformal_intervals
- Size
- 10 files, 79.5 KB
- Identity
library.supply.creative_originals.d14ec4f066a67babbfed2113.a12faaa2ff0abd67- Version
a12faaa2ff0abd670c73e4b22097fb40239805ed4b9956abdec6a968d4b00d01
The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.
Where it is shown
- Statistics for comparing resultsDeterministic skills
Related components
Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.