What fundamental problem does nested cross-validation address that flat cross-validation cannot?

Quick Overview

Explain why using one cross-validation score both to tune hyperparameters and to report performance gives an optimistic estimate, and how nested cross-validation separates the two. Tests understanding of selection bias, the outer and inner loop structure, and the cost of nested CV.

What fundamental problem does nested cross-validation address that flat cross-validation cannot?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

What fundamental problem does nested cross-validation address that flat cross-validation cannot? Assume you tune hyperparameters with cross-validation and also want to report how well the tuned model will do on new data. ```hint Think about selection If you compare many configurations by their CV scores and keep the best one, what happens to the expected value of the winning score? ``` ### What a Strong Answer Covers - Why reusing one CV score for both tuning and reporting makes the reported number optimistic - How the outer and inner loops are split, and which data each loop is allowed to touch - What the averaged outer scores actually estimate - The computational cost, and what nested CV does not give you ### Follow-up Questions - After running nested CV, how do you produce the model you actually deploy? - The best hyperparameters differ from one outer fold to the next. Is that a problem, and what does it tell you? - When is a single untouched test set a reasonable substitute for nested CV? - How would you set up nested CV for time-series data?

Overview: Explain why using one cross-validation score both to tune hyperparameters and to report performance gives an optimistic estimate, and how nested cross-validation separates the two. Tests understanding of selection bias, the outer and inner loop structure, and the cost of nested CV.

General logo
General
Nov 25, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

What fundamental problem does nested cross-validation address that flat cross-validation cannot?

Assume you tune hyperparameters with cross-validation and also want to report how well the tuned model will do on new data.

What a Strong Answer Covers Guidance

  • Why reusing one CV score for both tuning and reporting makes the reported number optimistic
  • How the outer and inner loops are split, and which data each loop is allowed to touch
  • What the averaged outer scores actually estimate
  • The computational cost, and what nested CV does not give you

Follow-up Questions Guidance

  • After running nested CV, how do you produce the model you actually deploy?
  • The best hyperparameters differ from one outer fold to the next. Is that a problem, and what does it tell you?
  • When is a single untouched test set a reasonable substitute for nested CV?
  • How would you set up nested CV for time-series data?