Conformal Prediction using Conditional Histograms

Matteo Sesia, Yaniv Romano

Introduction

In machine learning regression, simply predicting a single continuous value $Y$ given features $X$ is often insufficient; practitioners need to know the uncertainty of that prediction. Conformal prediction provides a mathematically rigorous way to generate a prediction interval $[L, U]$ that is guaranteed to contain the true value $Y$ with a user-specified probability (e.g., 90%), known as marginal coverage.

However, existing conformal regression methods, such as Conformalized Quantile Regression (CQR), typically construct these intervals symmetrically (e.g., estimating the 5th and 95th percentiles). If the underlying data distribution is highly skewed, a symmetric interval is sub-optimal and unnecessarily wide.

To address this, the authors introduce Conformal Histogram Regression (CHR), a method for generating prediction intervals that automatically adapts to skewed data. By estimating the conditional distribution of the target variable using histograms and applying conformal prediction, CHR produces the shortest possible intervals with guaranteed finite-sample marginal coverage. It consistently outperforms existing methods by extracting more information from the underlying black-box models to yield tighter, more informative bounds.

Methods: Conformal Histogram Regression

The core idea behind CHR is to estimate the full conditional distribution of the target variable and extract the densest region.

  1. Conditional Histograms: The domain of the continuous target $Y$ is partitioned into $m$ equal-sized bins. A black-box machine learning model (e.g., a neural network or random forest) is trained to predict the probability that $Y$ falls into each bin, effectively creating a conditional histogram for any given input $X$.
  2. Nested Oracle Intervals: For a desired probability mass $\tau$, the algorithm finds the shortest contiguous sequence of bins whose predicted probabilities sum to at least $\tau$. To ensure the method can be properly calibrated later, these intervals are forced to form a nested sequence (as $\tau$ increases, the intervals only grow and strictly contain the smaller ones).
Nested prediction intervals based on conditional histograms
  1. Conformal Calibration: Because the black-box model's histogram is just an estimate, naively trusting it won't guarantee actual coverage. CHR computes a conformity score for each sample in a hold-out calibration set, defined as the smallest $\tau$ required for the nested interval to contain the true $Y$. Using standard split-conformal prediction, CHR finds the empirical quantile of these scores to calibrate the final interval, guaranteeing $1-\alpha$ marginal coverage.

Note: The authors deliberately restrict the output to a single contiguous interval rather than a fragmented, multi-modal set, arguing that contiguous intervals are much easier for human decision-makers (like physicians) to interpret.

Key Insights and Ideas

  • Full Distributions Beat Fixed Quantiles: By looking at the entire estimated histogram rather than pre-fixed lower and upper quantiles, CHR can shift its interval to cover the densest regions. For a heavily right-skewed distribution, the shortest 90% interval might span the 0th to 90th percentiles rather than the symmetric 5th to 95th.
Comparison of CHR and CQR on skewed data
  • Nested Sequences Enable Calibration: You cannot simply pick the shortest interval from a flawed heuristic and expect mathematical guarantees. By structuring the histogram search as a nested sequence parameterized by $\tau$, CHR translates a complex density estimation problem into a simple scalar conformity score that conformal prediction can rigorously calibrate.
  • Asymptotic Optimality: The authors mathematically prove that if the underlying black-box model is consistent (i.e., it learns the true distribution as data approaches infinity), CHR's output converges exactly to the theoretical "oracle" shortest interval.

Experimental Results

The authors evaluated CHR on both synthetic and real-world datasets, comparing it to baselines like CQR, Distributional Conformal Prediction (DCP), and DistSplit.

  • Theoretical Guarantees: CHR provably achieves finite-sample marginal coverage and asymptotic conditional coverage with optimal length.
  • Synthetic Performance: On a 1D dataset designed to have varying degrees of skewness, CHR achieved an average interval length of 3.2, compared to 5.2 for CQR, while both maintained the target 90% coverage. As skewness increased, CHR's advantage over symmetric methods widened significantly.
  • Real-World Performance: Across 7 public datasets (including bio, blog, fb1/fb2, and meps19/20/21), CHR consistently produced the tightest prediction intervals compared to state-of-the-art baselines. It achieved this while maintaining excellent worst-slab conditional coverage, meaning the coverage remains valid across different sub-regions of the feature space.

Limitations and Future Work

  • Lack of Tail Control: A key limitation of CHR is that it does not rigorously control the lower and upper miscoverage rates separately. If an application strictly requires that the true value falls below the interval exactly 5% of the time and above it exactly 5% of the time, CQR remains the better choice.
  • Future Work: The authors suggest extending the method to handle multi-dimensional responses ($Y$). They also provide a supplementary algorithm for integrating CHR with Cross-Validation+ (CV+), which is more computationally expensive but avoids the data-splitting penalty of standard split-conformal prediction.

Summary updated

BibTeX
@inproceedings{sesia2021conformal,
  author = {Matteo Sesia and Yaniv Romano},
  title = {{Conformal Prediction using Conditional Histograms}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=Si3LJcmTah},
}
Figure