POSTECH · CSED105 · LECTURE 6
Choosing a Hyperparameter: Polynomial Degree
A more complex curve can fit training data closely, yet predict poorly on new data. Explore how the polynomial degree affects this trade-off. Training, validation, and test points are sampled independently around the same hidden polynomial, with independent noise.
Explore: Move the degree slider and compare the fitted curve and errors. New data also change the hidden degree that generated them.
Choose: Use validation error to select a degree.
Reveal: Keep moving k and compare all three error curves. In practice, never use test error to choose k.
Higher k allows a more flexible curve.
Model fit
The curve is fit using training points only.
Training data
Validation data
Test data
Error as degree changes
Training RMSEValidation RMSETest RMSE
Training RMSE
—
Validation RMSE
—
Test RMSE
—
Final check for the degree you selected.
Compare the two errors as k changes. Training error usually keeps falling; validation error may rise again.
Think about it
Which degree would you choose based on validation RMSE? Does the test error tell the same story?