Skip to main content
QUICK REVIEW

[Paper Review] Nested cross-validation when selecting classifiers is overzealous for most practical applications

Jacques Wainer, Gavin C. Cawley|arXiv (Cornell University)|Sep 25, 2018
Machine Learning and Data ClassificationComputer Science20 citations
TL;DR

This paper evaluates nested cross-validation (NCV) versus flat cross-validation (FCV) for classifier selection and finds that FCV—though biased—generally selects models of comparable performance to NCV when algorithms have few hyperparameters. For most practical applications, FCV is computationally efficient and sufficient, making NCV unnecessarily expensive in practice.

ABSTRACT

When selecting a classification algorithm to be applied to a particular problem, one has to simultaneously select the best algorithm for that dataset \\emph{and} the best set of hyperparameters for the chosen model. The usual approach is to apply a nested cross-validation procedure; hyperparameter selection is performed in the inner cross-validation, while the outer cross-validation computes an unbiased estimate of the expected accuracy of the algorithm \\emph{with cross-validation based hyperparameter tuning}. The alternative approach, which we shall call `flat cross-validation', uses a single cross-validation step both to select the optimal hyperparameter values and to provide an estimate of the expected accuracy of the algorithm, that while biased may nevertheless still be used to select the best learning algorithm. We tested both procedures using 12 different algorithms on 115 real life binary datasets and conclude that using the less computationally expensive flat cross-validation procedure will generally result in the selection of an algorithm that is, for all practical purposes, of similar quality to that selected via nested cross-validation, provided the learning algorithms have relatively few hyperparameters to be optimised.

Motivation & Objective

  • To assess whether the computationally intensive nested cross-validation (NCV) is necessary for selecting the best classification algorithm in practical applications.
  • To evaluate the performance of flat cross-validation (FCV), which uses a single CV loop for both hyperparameter tuning and model selection, despite its optimistic bias.
  • To determine if FCV yields models that are practically equivalent to those selected by NCV across a broad range of real-world datasets and algorithms.
  • To investigate the conditions under which NCV provides a meaningful advantage over FCV, particularly regarding hyperparameter count and model complexity.
  • To provide empirical guidance for practitioners on when to use FCV instead of NCV in real-world machine learning workflows.

Proposed method

  • Applied flat cross-validation (FCV) to tune hyperparameters and estimate performance in a single CV loop, introducing optimistic bias.
  • Used nested cross-validation (NCV) with separate inner and outer folds to tune hyperparameters and estimate unbiased generalization performance.
  • Evaluated 12 classification algorithms across 115 real-world binary datasets, comparing model selection outcomes between FCV and NCV.
  • Measured performance differences using mean accuracy differences, confidence intervals, and statistical significance (p-values) between the two methods.
  • Conducted additional analyses using alternative statistical definitions of irrelevance threshold and different analysis methods to test robustness of results.
  • Compared algorithm rankings and selection outcomes between FCV and NCV to assess consistency in model selection order.

Experimental results

Research questions

  • RQ1Does flat cross-validation (FCV) select classification models that perform as well as those selected by nested cross-validation (NCV) in practice?
  • RQ2How does the performance difference between models selected via FCV and NCV vary across datasets with different sizes and algorithm complexity?
  • RQ3Is the optimistic bias in FCV sufficient to lead to suboptimal model selection, especially when algorithms have many hyperparameters?
  • RQ4Under what conditions—particularly regarding the number of hyperparameters—does NCV provide a meaningful advantage over FCV?
  • RQ5To what extent do the rankings of algorithms differ between FCV and NCV, and does this affect practical model selection outcomes?

Key findings

  • For 115 real-world binary datasets, flat cross-validation selected models that performed as well as those selected by nested cross-validation in 80% of cases when considering the top three models.
  • The mean accuracy difference between models selected by FCV and NCV was -0.005 (95% CI: -0.014 to -0.002), indicating a small but statistically significant advantage for NCV, though this difference is negligible in practical terms.
  • When considering all 12 algorithms, 71% of selections were identical between FCV and NCV, with a p-value of 0.0108, indicating the results are statistically significant but not practically impactful.
  • The study found that FCV and NCV produce similar model selections for algorithms with few hyperparameters (1–3), but the advantage of NCV diminishes as hyperparameter count increases.
  • In cases with high hyperparameter complexity—such as LS-SVM with ARD kernel—FCV can overfit and lead to suboptimal selections, highlighting a key limitation of FCV in such scenarios.
  • The results remained robust under alternative statistical definitions of irrelevance and different analysis methods, confirming the stability of the findings.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.