3 hour session

Polynomial regression: flexibility, generalization, and control.

This session begins with a simple question: what if the relationship is clearly not a straight line? From there, students learn polynomial features, model complexity, bias-variance tradeoff, validation, cross-validation, and regularization.

Teaching story

Straight line fails Add curved features Model becomes flexible Validation detects risk Regularization controls it

Opening question

Can every useful prediction problem be solved with a straight line?

Use examples like house size vs price, experience vs salary, medicine dosage vs response, and ad spend vs sales. Many relationships increase, slow down, saturate, or bend.

Session roadmap

Reference anchors for the session

These are the big ideas the session will keep returning to:

Curve fitting is broader than regression

A fitted curve can summarize a relationship, interpolate between known observations, or support prediction. Regression focuses on learning from noisy data rather than forcing an exact pass through every point.

Polynomial regression is multiple regression

After creating \(x,x^2,x^3,\ldots\), the model becomes ordinary linear regression on transformed columns.

Complexity needs control

Higher degree can reduce bias, but it can also increase variance. Validation and regularization decide how much flexibility is useful.

Suggested 3 hour pacing

TimeFocusClass mode
0:00-0:35Motivation, polynomial equation, non-linear dataVisual explanation and questions
0:35-1:05Data simulation and model degreesCompare fits and discuss generalization
1:05-1:45Bias, variance, underfitting, overfittingConcept visuals and quick checks
1:45-2:20Validation, model selection, K-fold CVWorkflow and algorithm walkthrough
2:20-3:00Regularization, lambda, Ridge/Lasso simulationCoefficient shrinkage story and wrap-up

Useful reading links

LinkUse in class
Features and Polynomial Regression notesFeature scaling, square-root features, and feature engineering examples.
Curve fittingContext for fitting, interpolation, smoothing, least-squares approximation, and extrapolation risk.
Polynomial regressionDefinition, matrix form, and why the method is linear in estimated coefficients.
Bias-variance tradeoffInteractive intuition for repeated model fits, systematic error, variance, and the U-shaped error curve.
Previous Topic Start Session