CAB212 · Unit 2: Regression
Polynomial regression and model complexity
6 practice questions
Key points
- Still linear in the weights
- Degree d has d+1 parameters
- Too high a degree overfits
- Pick degree by validation error
Polynomial regression fits y = w0 + w1*x + w2*x^2 + ... + wd*x^d. It is still linear in the weights, so OLS applies after creating the powers of x as new features.
- Degree 1: straight line. Degree 2: parabola.
- Low degree underfits curved data; very high degree overfits, wiggling through noise.
Number of parameters for degree d in one variable = d + 1 (including the intercept). With n data points, a degree n-1 polynomial can pass through every point exactly (zero training error) but generalizes badly.
Choose the degree with validation error or cross-validation, and combine with regularization. High-degree features also need scaling because x^d becomes huge.
Exam pitfall: "polynomial" regression is not non-linear in the parameters; the model is linear in w.
Try two questions
Fitting a straight line to clearly curved data results in:
- Zero error
- Underfitting
- Zero bias
- Overfitting
Show the answer
B. A degree too low cannot capture the curve.
A very high degree polynomial usually has:
- Low bias and high variance
- High bias and high variance always
- No variance
- High bias and low variance
Show the answer
A. It is flexible, so it chases noise.