Train-Test Split
Before you can measure anything, you have to decide what to measure it on. Get that wrong and every metric in the rest of this unit will lie to you.
1What the split is
Each subset has exactly one job:
- The training set is used to make the model learn.
- The input elements of the testing set are given to the trained model. It makes predictions, and those predicted values are compared with the expected values.
The objective is to estimate how the model will perform on new data — data that was not used to train it. That is how the model will really be used: fitted on data whose answers you know, then asked about cases where you do not know the answer yet.
The first three columns are the features. The last one is the label — the answer we want the machine to give.
| Colourfeature | Sizefeature | Shapefeature | Fruitlabel |
|---|---|---|---|
| Red | Small | Round | Strawberry |
| Red | Medium | Round | Apple |
| Yellow | Medium | Long | Banana |
| Green | Medium | Round | Apple |
| Orange | Medium | Round | Orange |
| Yellow | Long | Long | Banana |
Labelled data. Every row carries its answer. A machine can learn the link between the features and the label from this — which is what supervised learning needs.
2Never mark your own homework
It is not recommended to evaluate a model on the data used to build it. The model will simply remember the whole training set, and will therefore always predict the correct label for any point in it.
The same model, marked two ways. One of these numbers is a lie.
Press the first button.
Press the second button.
Same model, two ways of marking it. Try both and compare.
The test with the answers attached
3From the board papers
(a) It helps the model learn faster (b) It reduces bias in the dataset (c) It improves performance on unseen data (d) It may lead to overfitting and give an overly optimistic accuracyCBSE sample paper 2025–26
▶Show the answer
(d) It may lead to overfitting and give an overly optimistic accuracy. The number you get back is high and meaningless — “overly optimistic” is exactly the right phrase for it.
▶Show the answer
Overfitting. The two halves of the question are the definition: perfect on the data it was trained on, useless on anything it has not seen.
▶Show the answer
Train-test split is a technique for evaluating a machine learning algorithm by dividing the dataset into two subsets — a training set and a testing set. The training set is used to make the model learn; the testing set is then fed to the trained model and its predictions are compared with the expected values, so that the model’s performance on new data can be estimated.
For example, with 1000 labelled images of masked and unmasked faces you might train on 800 and keep 200 aside. The model never sees those 200 while learning, so how well it does on them is a fair estimate of how it will behave on a face it has never met.
4Check yourself
What is the train-test split used for?
A model that memorises its training data and fails on new data is said to be:
Which subset does the model learn from?