Constructing Confidence Intervals for 'the' Generalization Error -- a Comprehensive Benchmark Study

Hannah Schulz-Kümpel, Sebastian Fischer, Roman Hornung, Anne-Laure Boulesteix, Thomas Nagler, Bernd Bischl

TL;DR

This paper presents the first large-scale benchmark study evaluating 13 different model-agnostic methods for constructing confidence intervals (CIs) for machine learning generalization error. By testing across 19 tabular datasets and 7 learning algorithms, the authors cut through the methodological noise to provide concrete recommendations on which CI techniques deliver reliable coverage without being overly conservative or computationally prohibitive.

What Problem Does This Paper Address?

When evaluating a machine learning model, practitioners typically report a single point estimate of its performance, such as a 10-fold cross-validation score. However, point estimates lack a measure of precision. To make reliable data-driven decisions—especially in high-stakes fields like medicine or finance—we need confidence intervals to quantify the uncertainty of these error estimates.

Deriving valid CIs for generalization error is notoriously difficult. Resampling techniques (like cross-validation and bootstrapping) repeatedly split and reuse the same data points for training and testing, creating complex, non-independent data dependencies. This violates the basic independent and identically distributed (i.i.d.) assumptions required by classical statistical inference. Consequently, there is no universal consensus on which CI methods work best, leading to a fragmented landscape of competing heuristics and sparse theoretical guarantees.

Methods

The authors implement and evaluate 13 model-agnostic CI methods within a unified framework. These methods span across different resampling paradigms:

  • Holdout-based: Standard single-split holdout.
  • Cross-Validation variants: CV Wald, Nested CV, Replace-One CV (ROCV), and Repeated Replace-One CV.
  • Subsampling approaches: Corrected Resampled-T (CRT) and Conservative-Z (CZ).
  • Bootstrap methods: Out-of-Bag (OOB), 632+ Bootstrap, Bootstrap Case CV Percentile (BCCVP), Location-shifted Bootstrap (LSB), and Two-stage Bootstrap (TSB).

Notably, the authors uncover a missing scaling constant ($\sqrt{1/2}$) in the variance estimator of a prominent existing method (Austern & Zhou, 2020), mathematically correcting it to ensure empirical validity.

Datasets

To rigorously evaluate the methods without data-leakage issues during massive replications, the authors required exceptionally large datasets to serve as "ground truth" targets (generating 100,000 external validation samples per process). They compiled a benchmark suite of 19 tabular datasets (9 regression, 10 binary classification):

  • Real data: The massive Higgs dataset (11 million observations).
  • Density-estimated data: 7 datasets simulated by fine-tuning a Large Language Model (GPT-2) on real-world OpenML datasets (e.g., adult, covertype, electricity, diamonds) to generate millions of realistic, independent rows.
  • Covariance-estimated data: 3 datasets (colon, breast, prostate) simulated from medical data covariance matrices.
  • Purely artificial data: 8 synthetic datasets designed to test specific linear and highly non-linear relationships (e.g., friedman1, bates).

The benchmark suite has been openly published on OpenML.

Key Insights and Ideas

  • Risk vs. Expected Risk: The paper emphasizes a crucial distinction often blurred in ML evaluation: Risk measures the error of a specific trained model, while Expected Risk measures the performance of the algorithm itself on a given data size.
  • The Resampling Bias: Methods like Holdout or CV Wald can suffer from pessimistic bias on smaller datasets because they evaluate models trained on subsets smaller than the full dataset size $n$.
  • Data Instability Destroys CIs: Datasets with heavy tails, extreme outliers, or high multicollinearity cause massive instability in point estimates. In these regimes, standard loss functions (like squared error) cause all CI methods to fail unless robust alternatives (like winsorized loss) are used.

Key Results

The benchmark reveals that three methods consistently outperform the rest, leading to clear, data-driven recommendations:

  • For Small Data ($n \le 100$): Use Nested CV (with $\ge 25$ outer repetitions, $K=5$) or Conservative-Z (with $\ge 25$ outer repetitions and $K \ge 10$). These provide remarkably accurate coverage.
  • For Larger Data ($n > 500$): Use Corrected Resampled-T (with a subsampling ratio of 0.9 and $\ge 25$ repetitions) or Conservative-Z (with 10 outer repetitions and $K=5$). Corrected Resampled-T strikes the best balance between accurate coverage, narrow interval widths, and low computational cost.
  • The Holdout Paradox: While a 90-10 Holdout split yields highly reliable CIs because it avoids resampling dependencies, its intervals are vastly wider (less precise) than the top-performing methods, making it practically inefficient.

Limitations and Future Work

The study focuses strictly on tabular data under i.i.d. conditions for binary classification and regression; structured data like time-series or text are out of scope. Crucially, the authors note that current CI methods assume the learning algorithm (inducer) is deterministic. When complex, stochastic hyperparameter tuning pipelines (like Bayesian Optimization) are integrated into model fitting, the added randomness causes even the best CI methods to degrade in performance. Future work must explicitly model this internal algorithmic uncertainty.

Summary updated

BibTeX
@misc{schulzkumpel2024constructing,
  author = {Hannah Schulz-Kümpel and Sebastian Fischer and Roman Hornung and Anne-Laure Boulesteix and Thomas Nagler and Bernd Bischl},
  title = {{Constructing Confidence Intervals for 'the' Generalization Error -- a Comprehensive Benchmark Study}},
  year = {2024},
  eprint = {2409.18836},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.18836},
}
Figure