New Paradigms in Modern Statistics I
Algorithm
The general split conformal algorithm, starting from adaptive prediction sets for classification, with application examples.
A standard conformal prediction procedure starts from a supervised dataset, i.e., data with labels. We denote the calibration dataset by , kept separate from the training data used to fit the model, and the new target test point by . Given a black-box model , we also start from some heuristic notion of uncertainty, which we call the score function. For example, the score can simply be the softmax score of a classification model, or the residual if we are doing regression.
For a target coverage level , the general conformal prediction algorithm is:1
- Compute the scores. .
- Compute the quantile. .
- Return the prediction set. .
For example, consider the Adaptive Prediction Sets (APS) algorithm, which is best known for the discrete case, i.e., . Here, we set the score function as
where is the softmax output of for class , and denotes the true label of . In other words, the score function indicates how difficult it is, for a given input, to guess its label correctly.2 The full method is described below.
Classification example: APS
- Split the labeled data into three disjoint parts: a training set of size that fits the black box , a calibration set of size , and a validation set of size held out to check coverage.
- Pass every calibration and validation point through once and cache its score . For APS, sort the softmax outputs and add them up from the top until you reach the true label.
- Collect the calibration scores and set to their empirical quantile.
- Run on the new input, sort its softmax outputs again, and keep the labels whose cumulative mass stays below : .