difficulty 2/5
Polynomial regression
Fitting a curve by adding powers and products of the original features, then running ordinary linear regression on the expanded set — still a linear model, now with a curved shape.
Intuition
Linear regression fits a straight line. Your data curves. The fix is smaller than it looks: you do not need a new algorithm, you need new columns.
Add x² as an extra feature and least squares will find a coefficient for it. The prediction is now a parabola in x, while remaining a weighted sum of features — which is the only sense in which "linear" was ever meant. The model is linear in its parameters, not in its picture [2, §5.2].
Formal definition
How it works
Where it's used
Why & when
Worked example
Pitfalls
Check yourself
3 questions
The questions on this page come with access. They are graded on the server, so the answers stay there until you have given yours.
On the cheat sheet: Linear models →
Sources
- scikit-learn — sklearn.preprocessing.PolynomialFeaturesdocs · retrieved 2026-08-31https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.PolynomialFeatures.html
- Deep Learning (2016)book · retrieved 2026-10-07https://www.deeplearningbook.org/
- scikit-learn — SplineTransformerdocs · retrieved 2026-10-07https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.SplineTransformer.html