Practical Guide to Applied Conformal Prediction in Python
Citation. Valery Manokhin. Practical Guide to Applied Conformal Prediction in Python: Learn and apply the best uncertainty frameworks to your industry applications. Packt, 2023, first edition. ISBN 978-1-80512-276-0. The author holds a PhD in machine learning from Royal Holloway, supervised by Vladimir Vovk, and keeps the "Awesome Conformal Prediction" list on GitHub. Code: PacktPublishing/Practical-Guide-to-Applied-Conformal-Prediction, using MAPIE, Fortuna, Nixtla's statsforecast, NeuralProphet and crepes.
Status. Planned. #109 scores probability forecasts, #10 holds the splitters, and #87 the harness. This book teaches conformal prediction: intervals and calibrated probabilities with a coverage guarantee. Its main lesson for the repo is where that guarantee stops: at ordered data. No code in the repo uses it yet.
Read. Read on 2026-11-28 from a copy of the book that the maintainer posted on #130, 236 pages. A subagent read all of it with pdftotext, chapters 9 and 10 less closely. Nobody saw the figures or ran the notebooks. I checked three passages and recomputed the log-loss example. The copy is not in the repo.
Summary
Claim. Conformal prediction turns any model's output into prediction sets, intervals or probabilities that are "valid". They cover the truth at least 1 − α of the time, whatever the model. The book says it is the only framework with such guarantees, and that time series and probability calibration have conformal solutions too.
Method. A practitioner's guide with Python examples.
- The guarantee. Score how unusual each calibration point is against the model, and set the interval at the right quantile of those scores. Then P(Y ∈ interval) ≥ 1 − α, averaged over data and calibration sets, if the data are exchangeable: their order carries no information.
- Regression. Split conformal, conformalised quantile regression (CQR), and the jackknife+, whose worst case is 1 − 2α.
- Classification and calibration. Prediction sets, and Venn–ABERS, which fits isotonic regression twice and merges the two probabilities as p₁/(1 − p₀ + p₁).
- Time series. EnbPI, a bootstrap-ensemble method, and the conformal intervals of NeuralProphet and Nixtla's statsforecast.
Findings, as the source reports them.
| Setting | Number | Value |
|---|---|---|
| CQR with 500 calibration points at 90% | coverage bounds | 90% to about 90.2% |
| Jackknife+ | worst-case coverage | 1 − 2α |
| EnbPI, hourly bike-sharing demand | coverage, interval width | 0.95, 0.4446 |
| NeuralProphet, hourly electricity load | coverage and width | none printed |
| Nixtla, 8 hourly M4 series | coverage and width | none printed |
| Venn–ABERS against Platt and isotonic scaling | result | a ranking from one cited thesis, no numbers |
| A calibration set | the book's minimum | at least 500 points, chosen at random |
The EnbPI result is the only empirical figure in the book. The CQR and jackknife+ bounds are correct.
Where the claims go beyond the evidence
The guarantee needs exchangeability, which returns don't have. The book says so: exchangeability "does not apply to time series, where the sequence of data points is crucial". Elsewhere it contradicts this. It says validity holds "as the underlying relationships evolve over time", and under "distribution shift". It also says conformal prediction gives guaranteed predictions "every time – regardless of the underlying prediction model, data distribution, or dataset size".
The guarantee is marginal, not per point, and not a ceiling on errors. Coverage of 1 − α holds on average. The book reads it as holding "for any given input", and says the error rate "will never surpass" the level set. A realised error rate can exceed it.
No evidence on financial or other nonstationary data. Finance appears only as an example sentence. The time-series chapter shows one coverage figure, with no baseline. The chapter doesn't cover ACI, SPCI or weighted conformal methods, which address shift. Nixtla's example uses two calibration windows. With so few residuals per horizon, split conformal can't give a finite 80% or 90% interval with its guarantee.
The calibration split ignores time. The book chooses the calibration set "randomly" and shuffles, "due to the exchangeability assumption". Nothing covers time order, leakage, purging or an embargo.
Venn–ABERS is overstated. The book says it gives "mathematical guarantees that the actual probability falls within this interval", regardless of data or model. The theory guarantees that one of the two probabilities is calibrated, under exchangeability. It doesn't say the true probability lies between them.
Errors in the text.
- The rain example's log loss is printed as 0.664. Its own Brier terms give each day's forecast error, and those forecasts give a log loss of 0.452. The Brier score of 0.144 is right.
- A forecast of 80% rain on days when it rains 60% of the time is called "well calibrated".
- Isotonic regression is said to need "an ROC AUC of 1", which is false. "Tight intervals" are said to have "higher coverage", which is backwards.
- Two findings of other papers are reversed: which models push scores toward 0 and 1, and the effect of weight decay on calibration.
Credit. The book states the exchangeability condition plainly in several places. It separates a prediction interval, for one future value, from a confidence interval for a parameter. It doesn't claim that conformal methods give an interval for a Sharpe or Sortino ratio.
Use in this repo
A conformal interval on returns has no guarantee. Returns are ordered, autocorrelated and shift over time, which breaks exchangeability. A strategy that sizes or stands aside by a conformal interval must test its coverage out of sample, by period. It mustn't rely on the 1 − α guarantee.
Calibration sets come after the training data, never at random. In a time series, the calibration block must follow the training block, with the purge and embargo of #10 between them. A random calibration set, as the book teaches, leaks the future.
Calibrate betting probabilities, and score the result. Venn–ABERS, Platt and isotonic scaling can calibrate a betting or prediction-market model. Whichever is used, #109's proper scores test the result on later events. A calibrator is one more choice for the ledger (#7).
Monitor coverage while paper trading. The book checks coverage once, out of sample. A forward test (#32) should track rolling coverage and width, by period, and flag a fall below 1 − α.
It doesn't give a metric's error. A conformal interval bounds a forecast. A Sortino or Sharpe ratio's error still comes from #8 and RQ2 (#29).
A question for the maintainer. Should a strategy that uses conformal intervals report its rolling coverage by period in paper trading? It would then fail the verdict (#12) if coverage stays below the stated level.