Skip to main content
QUICK REVIEW

[Paper Review] MAPIE: an open-source library for distribution-free uncertainty quantification

Vianney Taquet, Vincent Blot|arXiv (Cornell University)|Jul 25, 2022
Machine Learning and Data ClassificationComputer Science16 citations
TL;DR

MAPIE is an open-source, scikit-learn-compatible Python library that enables distribution-free uncertainty quantification for regression and multi-class classification using conformal prediction. It provides strong theoretical guarantees on marginal coverage with minimal assumptions, supporting methods like Jackknife+, CV+, and Jackknife+-after-Bootstrap for robust prediction intervals and sets.

ABSTRACT

Estimating uncertainties associated with the predictions of Machine Learning (ML) models is of crucial importance to assess their robustness and predictive power. In this submission, we introduce MAPIE (Model Agnostic Prediction Interval Estimator), an open-source Python library that quantifies the uncertainties of ML models for single-output regression and multi-class classification tasks. MAPIE implements conformal prediction methods, allowing the user to easily compute uncertainties with strong theoretical guarantees on the marginal coverages and with mild assumptions on the model or on the underlying data distribution. MAPIE is hosted on scikit-learn-contrib and is fully "scikit-learn-compatible". As such, it accepts any type of regressor or classifier coming with a scikit-learn API. The library is available at: https://github.com/scikit-learn-contrib/MAPIE/.

Motivation & Objective

  • To address the lack of model-agnostic, theoretically grounded uncertainty quantification tools in Python for machine learning.
  • To provide strong theoretical guarantees on prediction coverage with minimal assumptions on data or model distributions.
  • To enable seamless integration with any scikit-learn-compatible estimator, including deep learning and gradient boosting models.
  • To support both regression and multi-class classification tasks with uncertainty estimation via conformal prediction.
  • To promote transparency, trustworthiness, and regulatory compliance in AI systems through open-source, standards-compliant software.

Proposed method

  • Uses split- and cross-conformal prediction to construct prediction intervals (regression) or sets (classification) with guaranteed marginal coverage.
  • Employs conformity scores—residuals for regression, ranked softmax scores for classification—to measure how typical a prediction is.
  • Calibrates conformity scores on a separate calibration set to avoid overfitting and ensure valid coverage.
  • Estimates quantiles of the conformity score distribution at a user-defined risk level α to define prediction bounds.
  • Supports multiple conformal prediction variants: Jackknife+, CV+, and Jackknife+-after-Bootstrap for regression; score, cumulated_score, top_k, and random_cumulated_score for classification.
  • Provides a framework for extending to new conformal methods via refactorized base classes for MapieRegressor and MapieClassifier.

Experimental results

Research questions

  • RQ1How can uncertainty quantification be made model-agnostic and applicable to diverse ML models, including deep learning and gradient boosting?
  • RQ2Can conformal prediction methods provide strong theoretical guarantees on marginal coverage with minimal assumptions on data or model distributions?
  • RQ3How do different conformal prediction methods compare in terms of coverage accuracy, prediction set size, and robustness across varying risk levels?
  • RQ4What is the impact of calibration set size and model complexity on the reliability and efficiency of uncertainty estimates?
  • RQ5How can conformal prediction be extended to new ML settings such as time series, image segmentation, and object detection?

Key findings

  • MAPIE achieves the target marginal coverage across all tested risk levels (α) for both regression and classification tasks, even when model output scores are not calibrated probabilities.
  • The 'score' method in MapieClassifier produces the smallest average prediction set size across all α values, though it may yield empty sets in uncertain cases.
  • The 'cumulated_score' method ensures at least one label is always included, but leads to over-estimated marginal coverages at low α values.
  • The 'random_cumulated_score' method maintains coverage close to the target but introduces instability by randomly including the last label, potentially leading to empty sets.
  • The implementation of Conformalized Quantile Regression in MapieQuantileRegressor enables adaptive prediction interval widths that respond to local heteroscedastic noise.
  • MAPIE is fully compatible with scikit-learn estimators and supports wrapping non-scikit-learn models (e.g., deep learning models) via custom wrappers, enabling broad applicability.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.