Lesson 9 of 11 9 min · 93 words
Ridge regression
Least squares with an L2 penalty.
Ridge regression is least squares with an L2 penalty: . It has a closed-form solution:
Adding makes the matrix always invertible, which fixes problems when features are highly correlated (multicollinearity) or when there are more features than examples. Ridge shrinks all weights smoothly towards zero but rarely makes any exactly zero.
Formula to remember
Lasso objective
L1 penalty sets some weights exactly to zero.
Quick check · +5 XP