risk_control

risk_control

Conformal Risk Control.

This module provides tools for controlling arbitrary loss functions beyond standard coverage guarantees, following the framework of Angelopoulos et al. (2022).

Instead of controlling coverage P(Y ∈ C(X)) ≥ 1-α, Conformal Risk Control allows you to control expected loss: E[L(Y, C(X))] ≤ α for any monotone loss function L.

Single-label:

  • ConformalRiskController: Risk control for single-label classification.

Multi-label:

  • MultiLabelConformalClassifier: CRC/RCPS/LTT for multi-label problems.

Single-label losses:

  • fnr_loss, fdr_loss, precision_loss, recall_loss
  • miscoverage_loss, set_size_loss

Multi-label losses:

  • multilabel_recall_loss (monotone, CRC/RCPS compatible)
  • multilabel_precision_loss (non-monotone, requires LTT)
  • multilabel_hamming_loss (non-monotone, requires LTT)
  • multilabel_f1_loss (non-monotone, requires LTT)

References

  1. Angelopoulos, A. N., Bates, S., Candès, E. J., Jordan, M. I., & Lei, L. (2022). “Conformal Risk Control.” ICLR 2024.
  2. Bates, S., Angelopoulos, A. N., Lei, L., Malik, J., & Jordan, M. I. (2021). “Distribution-Free, Risk-Controlling Prediction Sets.” JASA.