Skip to content
ML Academy

Classical ML, validation, metrics, interpretation, debugging · insight-0158

Report a tuned model's performance from nested cross-validation, not from the search's best score

Evidence type
documented fact
Difficulty
medium
Roles
Data scientist, ML engineer
Industries
healthcare, cross-industry

Summary: situation, action, reason, boundary

  1. Situation

    You quote GridSearchCV.best_score_ (or the best of many experiments) as the expected production performance.

  2. Action

    Wrap the search in an outer cross-validation loop (or evaluate the selected configuration once on an untouched test set) and report the outer score.

  3. Reason

    Selection is part of the procedure being evaluated; only data unseen by the selection can estimate its performance honestly.

  4. Boundary

    Hyperparameter search, model-family comparison, feature-set choice, especially on small or noisy datasets.

Symptom or risk

The best score of many configurations is optimistically biased because the same folds chose and scored the winner.

Exceptions

With large data and a held-out test set used once, nested CV adds little beyond cost.

Trade-offs

Nested CV multiplies compute by the number of outer folds and reports the procedure, not one fixed model.

Pitfalls

Expecting nested CV to output the final model; refit the search on all training data afterwards.

Lessons and concepts

Claims and their sources