Inference for the Generalization Error

Claude Nadeau, Yoshua BengioMachine Learning 2003 · OpenReview

Abstract

To compare learning algorithms, researchers frequently employ statistical tests of significance to support claims of superior generalization. However, standard tests often fail to account for the variability introduced by the choice of training set, focusing instead on test example variability. This oversight leads to a significant underestimation of the variance in cross-validation (CV) estimators, resulting in "liberal" tests that frequently yield false positives. This paper provides a theoretical investigation into the variance of CV estimators, proving that no general unbiased estimator exists based solely on CV results. Consequently, the authors propose new estimators, including a "corrected" resampled t-test, which demonstrate improved size and power in empirical simulations.

The Hidden Trap in Algorithm Comparison

In machine learning, the ultimate goal is low generalization error—performance on unseen data. When comparing two algorithms, researchers typically use cross-validation. However, the error measured in these experiments is subject to two distinct sources of randomness: the selection of test examples and the selection of the training set used to build the model.

Historically, many statistical tests ignored the second source. By treating the results of different CV folds as independent, these tests drastically underestimate total variance. This leads to a "liberal" bias, where a test might have a 15–20% false positive rate despite being set at a 5% significance level. In essence, researchers were often claiming "significant improvements" that were actually just statistical noise.

The Theoretical "No-Go" Theorem

A central contribution of this work is the mathematical proof that there is no general unbiased estimator for the variance of a cross-validation experiment. Because training sets in different CV folds overlap, the resulting errors are inherently correlated. This correlation cannot be perfectly untangled using only the results of the CV experiment itself. This finding establishes a fundamental limit on the precision of standard model comparison techniques and explains why previous attempts to find a perfect test have failed.

Proposed Solutions: Corrected and Conservative Tests

Since a perfect estimator is theoretically impossible, Nadeau and Bengio propose two practical alternatives designed to mitigate the liberal bias of standard tests:

  1. The Corrected Resampled t-test: This method introduces a correlation factor ($\rho$) to account for the overlap between training sets. The authors suggest a simple, effective heuristic for this factor: $\rho = \frac{n_{test}}{n_{total}}$. This correction adjusts the variance estimate upward, making the test more realistic and harder to "pass" by chance.
  2. The Conservative Z-test: Designed for maximum reliability, this method splits data into independent halves. By repeating this process, it creates a variance estimate that is guaranteed (under specific conjectures) not to underestimate the true variance. This ensures that any result marked as "significant" is highly likely to be genuine, prioritizing scientific rigor over ease of publication.

Experimental Validation

The authors validated these new tests across three distinct environments:

  • Simple Linear Regression: A synthetic Gaussian setup allowing for analytical calculation of "true" generalization error.
  • Gaussian Classification: A task involving overlapping populations to test classification error limits.
  • UCI Letter Recognition: A real-world benchmark where a distorted first-nearest-neighbor rule was compared against decision trees.

The results confirmed that the Corrected Resampled t-test successfully brought the "size" (false positive rate) of the test down to intended levels (e.g., 10%), whereas standard tests were often twice as high as they should be. Furthermore, they found that increasing the number of random splits ($J$) beyond 15 yielded diminishing returns, recommending $J=15$ as a robust standard for researchers.

Conclusion

The shift toward more rigorous statistical standards is essential for the integrity of machine learning research. While the proposed correlation heuristic is a "naive surrogate," it performs remarkably well across diverse problems, from simple regression to complex classification. By adopting these corrected or conservative tests, the community can move away from "liberal" results and ensure that reported improvements in algorithm performance are statistically sound and reproducible.

Summary updated

Abstract

In order to compare learning algorithms, experimental results reported in the machine learning literature often use statistical tests of significance to support the claim that a new learning algorithm generalizes better. Such tests should take into account the variability due to the choice of training set and not only that due to the test examples, as is often the case. This could lead to gross underestimation of the variance of the cross-validation estimator, and to the wrong conclusion that the new algorithm is significantly better when it is not. We perform a theoretical investigation of the variance of a variant of the cross-validation estimator of the generalization error that takes into account the variability due to the randomness of the training set as well as test examples. Our analysis shows that all the variance estimators that are based only on the results of the cross-validation experiment must be biased. This analysis allows us to propose new estimators of this variance. We show, via simulations, that tests of hypothesis about the generalization error using those new variance estimators have better properties than tests involving variance estimators currently in use and listed in Dietterich (1998). In particular, the new tests have correct size and good power. That is, the new tests do not reject the null hypothesis too often when the hypothesis is true, but they tend to frequently reject the null hypothesis when the latter is false.
BibTeX
@article{nadeau2003inference,
  author = {Claude Nadeau and Yoshua Bengio},
  title = {{Inference for the Generalization Error}},
  journal = {Machine Learning},
  year = {2003},
  url = {https://openreview.net/forum?id=Hx-G3Gy8Hl5},
}
Figure