Conformal Prediction in Regression: how NOT to Build Intervals (and How to Fix Mistakes)

Conformal Prediction in Regression: how NOT to Build Intervals (and How to Fix Mistakes)

Conformal Prediction (CP) is the gold standard for building intervals with guaranteed coverage. But even here, things can go wrong if you don’t understand the nuances of the methods. Today, we’ll break down two approaches—Naive and Jackknife—and uncover their pitfalls.

Spoiler: Most mistakes stem from violating the key principle of CP—splitting data into training and calibration sets.


?? The Naive Method: Why It’s Not So "Naive" (But Dangerous)

What People Get Wrong: Classical CP requires strict splitting of data into training and calibration sets. However, many in the "naive" approach:

  1. Train the model on all the data.
  2. Calculate residuals on the same data.
  3. Use the quantile of residuals to build the interval.

The Problem: This violates the exchangeability principle. Residuals on training data are underestimated—the model has already "seen" them, leading to overly narrow intervals.

The Right Way (Split Conformal):

Critique:

  • ? Pros: Simplicity and speed.
  • ? Cons: If the calibration set is small, the quantile will be inaccurate → coverage suffers.
  • ?? Myth: The "naive method" in CP is NOT training on all data. It’s Split Conformal with mandatory splitting!


?? Jackknife: Why It’s Dead, Long Live Jackknife+

What People Get Wrong: The original Jackknife (leave-one-out) in CP does not provide valid coverage for modern models.

The reason: a model trained on n?1n?1 observations can differ significantly from the full model → residuals are incomparable.

Code (Simplified):

Critique:

  • ? Pros: Accounts for both model error and its sensitivity to data.
  • ? Cons: Computational complexity O(n)O(n)—unfeasible for large datasets.
  • ?? Important: Jackknife+ requires the model to be stable (small changes in data → small changes in predictions). For neural networks, this rarely holds!


?? Comparison: When to Use What?

?? Key Takeaways and Life Hacks

  1. Never calibrate on training data—it’s a cardinal sin in CP.
  2. For deep learning, Split Conformal is often the only option—Jackknife+ is computationally infeasible.
  3. Check coverage on test data: if empirical coverage ≈ 1?α, the method is correct.
  4. Try CQR (Conformalized Quantile Regression)—a hybrid method for heteroscedastic data.

Personal Experience: In production, Split Conformal works 90% of the time. Reserve Jackknife+ for high-stakes tasks (medicine, finance) where the cost of error is your company’s reputation.

Have you faced issues with interval coverage? Share your stories in the comments! ??

#MachineLearning #DataScience #ConformalPrediction #AI #ML #DL

要查看或添加评论,请登录

Sergei Scherbakov的更多文章

社区洞察

其他会员也浏览了