How is cross-validation used to choose between candidate models or hyperparameter settings?

Quick Overview

Explain how K-fold cross-validation is used to compare candidate models or hyperparameter settings and pick one. Tests fair paired comparisons, leakage-free pipelines, handling noisy score differences, choosing the right splitter, and reporting performance without selection bias.

How is cross-validation used to choose between candidate models or hyperparameter settings?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

How is cross-validation used to choose between candidate models or hyperparameter settings? ```hint Make the comparison fair Think about what makes a comparison between two candidates fair, and how much their scores would move if you reshuffled the folds. ``` ### What a Strong Answer Covers - How folds are set up so candidates are compared fairly - Where preprocessing is fitted - Accounting for noise when candidates score close together - Choosing a splitter that matches the structure of the data - What happens after selection and how final performance is reported ### Follow-up Questions - How does nested cross-validation work, and when is it worth the cost? - Why is a plain paired t-test on per-fold scores too optimistic? - How would you choose the number of folds? - How does the optimism of the best CV score change as you search more candidates?

Overview: Explain how K-fold cross-validation is used to compare candidate models or hyperparameter settings and pick one. Tests fair paired comparisons, leakage-free pipelines, handling noisy score differences, choosing the right splitter, and reporting performance without selection bias.

Nov 24, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

How is cross-validation used to choose between candidate models or hyperparameter settings?

What a Strong Answer Covers Guidance

  • How folds are set up so candidates are compared fairly
  • Where preprocessing is fitted
  • Accounting for noise when candidates score close together
  • Choosing a splitter that matches the structure of the data
  • What happens after selection and how final performance is reported

Follow-up Questions Guidance

  • How does nested cross-validation work, and when is it worth the cost?
  • Why is a plain paired t-test on per-fold scores too optimistic?
  • How would you choose the number of folds?
  • How does the optimism of the best CV score change as you search more candidates?