/knowledge/conformal-prediction
Conformal Prediction & Uncertainty
A model that says '0.7' with no sense of how sure it is can't be trusted with a decision. Conformal prediction wraps almost any model in an honest, guaranteed uncertainty range — with no assumptions about the model or the data.
- Studied
- Conformal Prediction & Uncertainty QuantificationAdvanced · honest uncertainty
- When
- Statistics & ML
- Applied in
- Defensible prediction ranges
- Read / Refreshed
- ~15 min read2026-06-26
A model that outputs a single number — "the risk is 0.7", "the forecast is 240" — is hiding the most important part: how sure is it? A confident 0.7 and a wild guess of 0.7 should drive very different decisions, and a point prediction can't tell them apart. Uncertainty quantification is the discipline of attaching honest error bars to predictions, and conformal prediction is its most remarkable modern tool: a way to wrap any model — including an opaque deep network — in a prediction range that comes with a mathematical coverage guarantee, under almost no assumptions.
It's a genuine gap-filler in this section and increasingly essential anywhere a model's output feeds a real decision. This page is the idea: why a bare prediction is dangerous, what conformal prediction guarantees, the surprisingly simple mechanism behind it, and where the guarantee stops. It builds on the calibration ideas from the model-evaluation page.
01
Why a number isn't enough
Decisions hinge not just on the prediction but on the confidence around it. "There's a 70% chance of rain" might mean carry an umbrella; "70%, but it could easily be 40% or 90%" means something else. Treating a point estimate as if it were certain is one of the most common and consequential mistakes in applied modelling — it strips away exactly the information a decision-maker needs to weigh risk.
What you want instead is a range with a known reliability: not "240" but "between 210 and 270, and that range is right 90% of the time." That second clause — the guarantee — is the hard part, and what makes conformal prediction special.
02
Two kinds of uncertainty
It helps to distinguish two sources of uncertainty, because they behave differently:
- Aleatoric — irreducible randomness in the world itself (a fair coin is genuinely unpredictable). More data won't shrink it.
- Epistemic — uncertainty from the model's ignorance: too little data, or an input unlike anything it trained on. This can shrink with more or better data — and it's why a model should be far less sure about cases far from its training distribution.
A good uncertainty estimate reflects both — wider where the world is noisy and wider where the model is out of its depth. Conformal prediction's appeal is that it delivers a valid range capturing this, without you having to model either source explicitly.
03
The conformal idea: a guarantee, for free
Conformal prediction turns any model's point prediction into a set or interval that's guaranteed to contain the true answer at a rate you choose. Pick a confidence level — say 90% — and conformal prediction produces intervals such that, across future cases, the true value falls inside at least 90% of the time. Formally, for a chosen error rate (here 0.1), the prediction set satisfies:
What makes this extraordinary is how few strings are attached. It's distribution-free (no assumption that errors are normal or anything else), model-agnostic (it wraps around any predictor — linear model, random forest, neural net, a black box you can't see inside), and the guarantee holds in finite samples, not just asymptotically. You don't have to trust the model to trust the coverage — a rare and valuable promise.
04
How it works: calibrate, then threshold
The mechanism (in its common "split conformal" form) is surprisingly simple — three steps:
- Set aside a calibration set — data the model didn't train on.
- Compute a nonconformity score for each calibration point — basically, how wrong the model was (e.g. the size of the residual). This builds an empirical picture of the model's actual error distribution.
- Take the quantile of those scores (the 90th percentile for 90% coverage) as a threshold. For any new input, the prediction interval is the point prediction plus or minus that threshold.
The elegance: the interval width is calibrated against the model's real, observed mistakes on held-out data, which is exactly why the coverage guarantee holds — you're not assuming the errors look a certain way, you're measuring them. (The one assumption is exchangeability — that calibration and future data are drawn alike; more on that below.)
05
Prediction sets & adaptive intervals
The output adapts to the task, and the best versions adapt to the difficulty too:
- Classification → a prediction set of labels. When the model is confident, the set holds one label; when it's unsure, the set contains several ("it's a 3, 5, or 8") — the size of the set is itself an honest signal of uncertainty.
- Regression → a prediction interval. With adaptive methods (like conformalized quantile regression), the interval widens where the model is less certain and narrows where it's confident — so the band is tight on easy cases and appropriately cautious on hard ones.
That adaptivity is the practically valuable bit: a fixed-width band is honest on average but uninformative; an interval that grows on the hard cases tells a decision-maker exactly where to be careful.
06
The fine print
The guarantee is real but precise, and misreading it is the main risk:
07
Where it shows up in my work
08
Refresh in 60 seconds
The distribution-free coverage guarantee, the split-conformal calibration mechanism, and the marginal-coverage / exchangeability caveats reflect current conformal-prediction references alongside ML coursework.