My Academic TutorLearn with understanding.
Menu
DATA SCIENCE · LEARNING GUIDE

Train/test split and cross-validation: what problem each one solves

Understand why model evaluation needs data the fitting process did not get to optimise against.

Why training performance is not enough

A model is selected to fit the training data, so evaluating it on the same observations usually gives an optimistic picture of how it will perform on new cases. Flexible models can learn noise as well as signal.

The purpose of held-out evaluation is to approximate performance on future data generated from a similar process.

What a train/test split does

A simple split reserves one part of the data for model development and another for evaluation. The test set should not be repeatedly inspected during tuning, because each decision based on test performance leaks information back into the modelling process.

With limited data, one split can also be unstable because results depend on which observations happen to fall into each set.

How cross-validation helps

In k-fold cross-validation, the training portion is divided into k folds. The model is trained on k−1 folds and evaluated on the remaining fold, repeating until every fold has served as validation data.

Averaging performance across folds uses the available data more efficiently for model comparison and tuning. A separate final test set can then provide a less biased final performance estimate.

Avoid leakage

Preprocessing steps that learn from data—such as scaling by sample means, imputation, feature selection or target encoding—should be fitted inside each training fold rather than on the full dataset before cross-validation.

Leakage can make validation performance look much better than what a real deployment will achieve.

Use this actively

Close the guide and explain the main idea without looking back. Then work through a fresh example. The first step you cannot explain is usually the best place to focus your next revision session.

About this guide: Educational content from My Academic Tutor. It is intended to support understanding and independent study, not replace course-specific teaching, supervision or assessed work.

Read our Learning Hub editorial approach