All courses › Machine Learning and Data Analysis › Training and test data

Training and test data

A model learns from training data and is measured on test data it has never seen. That gives an honest picture of how well it works on new cases. If the model is much better on training data than on test data, it has overfitted.

Ntest=f⋅NN_{test} = f\cdot Nnumber of test rows with share f
gap=accuracytrain−accuracytest\text{gap} = \text{accuracy}_{train} - \text{accuracy}_{test}a large gap suggests overfitting

Symbols

NNnumber of rows
ffshare for testing, often 0.2

Example

5000 rows with an 80/20 split:

4000 for training and 1000 for testing.

Do not look at the test data while building the model. Then it is no longer an honest test.
Practise data and core concepts for free →

Normalization →

Part of Machine Learning and Data Analysis: Data and core concepts.