Classification — Theory¶
Four methods for multi-class uncertainty quantification have been implemented in MAPIE: LAC (Least Ambiguous set-valued Classifier) 1, APS (Adaptive Prediction Sets) 2 3, Top-K 3, and RAPS 3.

Illustration of the three methods implemented in MAPIE.
Mathematical Setting¶
For a classification problem in a standard i.i.d. case, our training data \((X, Y) = \{(x_1, y_1), \ldots, (x_n, y_n)\}\) has an unknown distribution \(P_{X, Y}\).
For any risk level \(\alpha \in (0, 1)\), the methods allow constructing a prediction set \(\hat{C}_{n, \alpha}(X_{n+1})\) with a marginal coverage guarantee:
For a typical \(\alpha = 10\%\), we construct prediction sets that contain the true observations for at least 90% of new test data points.
Info
The guarantee applies only to marginal coverage, not conditional coverage \(P \{Y_{n+1} \in \hat{C}_{n, \alpha}(X_{n+1}) \mid X_{n+1} = x_{n+1}\}\), which depends on the location of the test point.
The CIFAR-10 prediction-set notebook applies these methods to an image classifier and compares their marginal and class-conditional coverage.
The LAC, Top-K, APS, and RAPS methods are described in Conformity Scores.
Split- and Cross-Conformal Strategies¶
MAPIE includes both split- and cross-conformal strategies for LAC and APS, but only split-conformal for Top-K and RAPS.
The cross-conformal implementation follows Algorithm 2 of 2:
- Split training into \(K\) disjoint subsets.
- Fit \(K\) classification functions \(\hat{\mu}_{-S_k}\).
- Compute out-of-fold conformity scores.
- For new test points, compare conformity scores to decide label inclusion.
For APS (see eq. 11 of 2):
References¶
-
Sadinle, Mauricio, Jing Lei, & Larry Wasserman. "Least Ambiguous Set-Valued Classifiers With Bounded Error Levels." JASA, 114:525, 223-234, 2019. ↩
-
Romano, Yaniv, Matteo Sesia and Emmanuel J. Candès. "Classification with Valid and Adaptive Coverage." NeurIPS 2020 (spotlight). ↩↩↩
-
Angelopoulos, Anastasios N., Stephen Bates, Michael Jordan and Jitendra Malik. "Uncertainty Sets for Image Classifiers using Conformal Prediction." ICLR 2021. ↩↩↩