conformalpy
Conformal Prediction for Python
conformalpy is a Python library for conformal prediction with support for classification (binary and multiclass), regression, and a complete operational framework.
Key Features
- Classification: ICP, CV+, Mondrian (class-conditional and flexible groups)
- Regression: Split conformal, CQR, Normalized, Jackknife+
- Runtime Alpha: Change confidence level at prediction time without recalibration
- Operational Framework: Outcome categorization, decision rules, cost-benefit analysis
- Rich Visualization: Coverage plots, prediction intervals, outcome FCODs
- sklearn Compatible: Follows scikit-learn API conventions
Quick Example
from conformalpy.classifier import ConformalClassifier
cc = ConformalClassifier(model=model, alpha=0.10)
cc.calibrate(X_cal, y_cal)
prediction_sets = cc.predict(X_test) # Sets with 90% coverage guaranteeGet Started
- Why conformalpy? — What makes this library different
- Introduction — Installation and core concepts
- Quickstart — Hands-on walkthrough
- Choose a Method — Select the right approach
Citation
The conformalpy library paper is in preparation. If you use the FCOD or p-value-margin SHAP functionality, please cite:
@inproceedings{caparrini2026explaining,
author = {Antonio Caparrini and Miller-Janny Ariza-Garz{\'o}n and Javier Arroyo},
title = {Explaining Conformal Prediction: Diagnosing Reliability through Feature-Conditioned Outcomes and p-Value Margins},
booktitle = {Proceedings of the Fifteenth Symposium on Conformal and Probabilistic Prediction with Applications},
series = {Proceedings of Machine Learning Research},
volume = {329},
year = {2026},
publisher = {PMLR},
note = {Conditionally accepted}
}