Introduction
Machine learning models often struggle when the data distribution at deployment differs from the training distribution. A common scenario is label shift, where the relationship between features ($X$) and labels ($Y$) remains constant, but the marginal distribution of labels ($p(y)$) changes. This paper introduces a mathematically rigorous framework to adjust uncertainty estimates—specifically prediction sets and calibrated probabilities—under label shift using only unlabeled data from the target environment.
The Challenge of Label Shift
Standard Uncertainty Quantification (UQ) methods, such as conformal prediction and post-hoc calibration, typically rely on the independent and identically distributed (i.i.d.) assumption. When label shift occurs, these methods lose their guarantees. For instance, a model designed to provide 90% coverage might only achieve 70% in a new environment where class proportions have shifted, posing significant risks in safety-critical applications like medical diagnostics.
Proposed Methods
The authors adapt two primary UQ frameworks to maintain reliability under label shift:
- Label-Shifted Conformal Prediction: This method incorporates a reweighting mechanism into the standard conformal prediction pipeline. By using importance weights—the ratio of class frequencies in the target vs. source distributions—the calibration thresholds are adjusted to ensure the desired coverage level is met in the new environment.
- Label-Shifted Calibration: The paper demonstrates that "post-hoc binning" for calibration can be made robust to label shift. By reweighting bins based on estimated label shifts, the resulting predictors achieve asymptotic calibration in the target domain.
- Label-Conditional Conformal Prediction: This alternative approach performs conformal prediction independently for each class. While inherently robust to label shift, it requires substantial calibration data for every class to be effective.
Importantly, these methods utilize techniques like Black Box Shift Estimation (BBSE) to estimate weights from unlabeled target data, removing the need for ground-truth labels in the deployment environment.
Experimental Validation
The framework was validated using both synthetic and real-world datasets, such as the Wine Quality dataset from UCI. In synthetic 2D simulations, the authors visualized how prediction sets adapt to shifts and how coverage fails if the shift is ignored.
Results showed that "uncorrected" models suffered significant coverage drops, while the proposed reweighted methods successfully recovered the nominal coverage levels. Even with estimated weights, performance closely matched the "oracle" scenario where true weights are known.
Key Insights and Results
- Low-Dimensional Correction: Unlike covariate shift (shifting features $X$), which is high-dimensional and difficult to correct, label shift is low-dimensional (dependent on the number of classes $K$), making it more amenable to robust fixes.
- Coverage Recovery: As shown in the coverage histograms, the uncorrected method's coverage distribution shifts far to the left of the target, whereas the reweighted methods center around the nominal 90% level.
- Calibration Error Bounds: The paper provides a theoretical bound for calibration error in the target environment, linking it to the original calibration error and the accuracy of the weight estimation.
Conclusion and Future Work
This research provides a practical path for deploying reliable ML models in dynamic environments. Future work includes addressing the "circular gap"—where shift estimation requires calibration, and calibration requires shift estimation—and improving data efficiency for label-conditional methods in the presence of rare classes.
Summary updated