1. University MCA (AI/ML) Semester 2
  2. CAB212
  3. Unit 2

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

Question 1 · Tier 2, Understand

Fitting a straight line to clearly curved data results in:

  1. Zero error
  2. Underfitting
  3. Zero bias
  4. Overfitting
Show the answer

B. A degree too low cannot capture the curve.

Question 2 · Tier 3, Apply

A very high degree polynomial usually has:

  1. Low bias and high variance
  2. High bias and high variance always
  3. No variance
  4. High bias and low variance
Show the answer

A. It is flexible, so it chases noise.