Overfitting vs. underfitting (concept)
Computer Science · AI/ML fundamentals
Question 1 of 10
0A hyperparameter, such as a learning rate or tree depth, is:
Stuck? Read the explanation
Unlocks at a streak of 5 correct answers in a row.
Embed this practice on your site or class page
Paste this HTML into your page. Students practise right there; it is free and needs no account.
Overfitting vs. underfitting (concept) explained
Overfitting happens when a model learns the training data too closely, including its noise, so it performs poorly on new data. Underfitting happens when a model is too simple to capture the real pattern, so it performs poorly even on the training data.
A model is judged on examples it has not seen, so the data is usually split into a training set and a validation set.
An overfitted model has low error on the training set but much higher error on the validation set. It has memorised details, such as random noise, that do not generalise. Causes include a model that is too complex for the amount of data and training for too long.
An underfitted model has high error on both sets. It is too simple or too constrained, or it has not been trained enough to learn the pattern.
For overfitting, use more data, simplify the model or stop training earlier. For underfitting, use a more expressive model or add useful features.
Worked example
Hypothetical results for two models on the same task:
- Model A has training error 2% and validation error 15%. The gap of percentage points suggests overfitting.
- Model B has training error 20% and validation error 22%. Both errors are high and close together, which suggests underfitting.
Model A learned the training data well but generalises poorly. Model B fails on both sets, so it needs more capacity or better features.
What you will practise
100 multiple-choice questions (Easy, Medium, Hard). Each answer is followed by an explanation.
Example questions
- Overfitting means the model:
- Underfitting means the model:
- Overfitting performs well on:
- Underfitting performs poorly on:
- Regularisation helps prevent:
- A model with high error on both its training data and its test data is most likely:
- A model that memorises random noise in its training data rather than the underlying pattern is:
- A model that is too simple to capture the true pattern in the data is said to be:
…and 92 more.