Before you readIf a curve hits every training point, what could still make it a bad fit?
Watch: Machine Learning Fundamentals: Bias and Variance · StatQuest with Josh Starmer
Training error measures predictions on the data used to fit the model. Test error measures predictions on held-out data. A model overfits when it learns noise in the training set instead of the underlying pattern, so a low training error can hide a high test error.
At a fixed input, the expected squared prediction error splits into:
- Bias is the difference between the average prediction over training sets and the true mean response.
- Variance is how much predictions vary across training sets.
- Noise is the variation in the response that the input cannot predict.
To pick a polynomial degree with -fold cross-validation, split the training set into folds and fit each candidate degree times, validating on a different fold each time and training on the rest. Pick the degree with the lowest mean validation error, refit on the whole training set and reserve the test set for final evaluation.
Train MSE = 0.03Test MSE = 0.01
Recall
What can low training error and high test error indicate?Recall
What are the three terms in expected squared prediction error?Recall
In one round of -fold cross-validation, which data fit the model?Exercise
At one input, the bias is the variance is and the noise variance is What is the expected squared prediction error?Exercise
Which pair of errors most strongly suggests overfitting?