Split Conformal Prediction and the Coverage Guarantee
Summary
Split (inductive) conformal prediction freezes a model trained on one fold, scores a disjoint calibration fold of size , and thresholds test-time scores at the -th smallest calibration score. Exchangeability makes the rank of the test score uniform on , which yields for any model, score and data distribution. Conditional on a particular calibration set, realised coverage is a random variable with , which is what determines how large must be (roughly 1000).
Overview
Full conformal prediction (see the definition in the overview) refits the model for every candidate label. Split conformal (Papadopoulos et al. 2002; Lei et al. 2015) avoids this by treating the model as fixed: the training fold is used only to fit , and the calibration fold only to compute scores. Conditional on , the score function is a fixed measurable map, so the calibration scores and the test score inherit exchangeability from the data. Tibshirani et al. (Sec. 2.2) emphasise that split conformal “can be seen as a special case of conformal prediction, in which the regression function is treated as fixed”, so every result for full conformal carries over.
The cost is statistical: only part of the data trains the model and only part calibrates. The benefit is computational triviality — one model fit and one quantile.
Main Content
Split conformal prediction ^alg-split-conformal
Input: data , miscoverage level , learning algorithm , score function template .
- Randomly split indices into a proper training set and a calibration set with .
- Fit . Any algorithm is allowed; unlike full conformal it need not treat data symmetrically (Romano et al., footnote 3).
- Compute calibration scores for .
- Set to the empirical quantile of , i.e. the -th smallest score; if that index exceeds .
- Output: .
For regression with this is (Romano et al. Eq. 8), a band of constant width .
An equivalent formulation (Tibshirani et al. Eq. 5, 9) replaces the inflated level by an augmented sample: . Placing a point mass at stands in for the unknown test score, and is the form that generalises to weighted conformal prediction.
Quantile lemma (Tibshirani et al. 2019, Lemma 1) ^thm-quantile-lemma
If are exchangeable random variables, then for any ,
If ties occur with probability zero, the probability is also at most .
Proof sketch. Replacing by does not change whether is below the quantile, so the event equals ” is among the smallest of “. By exchangeability the rank of is uniform on , so this has probability when there are no ties. Romano et al. (Appendix A, Lemma 2 “inflation of quantiles”) state the same fact with the level.
Split conformal coverage (A&B Theorems D.1–D.2; Romano et al. Theorem 1) ^thm-split-coverage
If , , and are exchangeable, then
and if the scores have a continuous joint distribution,
The result holds conditionally on the proper training set.
The A&B proof (App. D) is three lines. Sort the calibration scores . The events and coincide. By exchangeability for every integer , so coverage equals . When , and trivially covers.
What is and is not assumed
- Assumed: exchangeability of calibration and test points (i.i.d. is sufficient, not necessary), and that the score function does not depend on the calibration or test data.
- Not assumed: correctness of , any parametric family, homoscedasticity, large . A useless model yields valid but uninformative (huge) sets.
- Broken by: time-series dependence, covariate shift, label shift, tuning the model on the calibration fold, or re-using the calibration fold for early stopping.
Coverage conditional on the calibration set
The guarantee averages over calibration draws. For one fixed calibration set the coverage over an infinite test set is random (Vovk 2012; A&B Sec. 3.2):
Beta law of realised coverage ^thm-beta-coverage
With continuous scores,
The distribution concentrates around at rate .
For and realised coverage is “typically between .88 and .92”, the basis of A&B’s rule of thumb that about 1000 calibration points suffice. Their Table 1 gives the needed so that coverage is within with probability at :
| 0.1 | 0.05 | 0.01 | 0.005 | 0.001 | |
|---|---|---|---|---|---|
| 22 | 102 | 2491 | 9812 | 244390 |
Checking an implementation (A&B Sec. 3.3, App. C)
Run random calibration/validation splits of cached scores and record empirical coverages . Each is with , i.e. beta-binomial. The average has
Deviations of from much larger than this indicate a bug (most commonly leakage between training and calibration folds, or a wrong quantile level).
Examples
By hand. Nine calibration residuals : .
- : , so and . The test residual is equally likely to fall in any of the 10 gaps, and 8 of them lie at or below : coverage is exactly (not , the naive empirical quantile’s implied level — the accounts for the test point).
- : , so , coverage exactly .
- : , so . With one cannot certify more than 90%: informative sets need .
Coverage check with score caching (A&B Figure 12):
import numpy as np
def coverage_check(scores, n, alpha=0.1, R=1000, seed=0):
rng = np.random.default_rng(seed)
cov = np.empty(R)
for r in range(R):
rng.shuffle(scores)
cal, val = scores[:n], scores[n:]
qhat = np.quantile(cal, np.ceil((n + 1) * (1 - alpha)) / n, method="higher")
cov[r] = (val <= qhat).mean() # covered <=> s(X, Y) <= qhat
return cov.mean(), cov # mean should be ~ 1 - l/(n+1)Connections
- Conformal Prediction - Overview — context, full conformal, and the extensions map.
- Permutation Tests and Exact Inference — the uniform-rank argument is the same one that makes permutation -values exact; conformal sets are inverted permutation tests. Compare the Monte Carlo -value with the in the conformal quantile: both add one for the observed/test point.
- Fisher Randomization Test and the Sharp Null — finite-sample exactness from symmetry of a known assignment mechanism, versus symmetry of sampling here.
- Conformity Scores and Adaptive Prediction Sets and Conformalized Quantile Regression — replacing the absolute residual so that widths vary with .
- Marginal vs Conditional Coverage — the guarantee above is marginal over ; the Beta law is “training-conditional” coverage, a different notion again.
- Conformal Prediction Under Covariate Shift — generalises the quantile lemma to weighted exchangeability.
See Also
- Cross Validation Checking — hold-out logic for predictive evaluation in Bayesian workflow; conformal calibration folds play an analogous role but deliver a guarantee rather than a diagnostic.
- Posterior Predictive Checking — model-based predictive intervals whose frequentist coverage depends on model correctness.
- Simulation-Based Calibration - Overview — rank-uniformity is also the engine of SBC, but applied to posterior draws versus prior draws rather than test scores versus calibration scores.
- Power Analysis and Sample Size — analogous planning question; here the sample-size driver is the Beta spread of realised coverage.