Lesson 5.7 · 8 min read · about 50 min to master at a very slow pace
Ridge versus LASSO
Why LASSO produces exact zeros and ridge does not, explained with the constraint geometry of a disc versus a diamond. A full side-by-side comparison with subset selection, plus an interactive shrinkage explorer.
The constraint view
Each penalised problem is equivalent to minimising RSS subject to a budget on the coefficients:
RSS contours are ellipses centred on the OLS solution. The answer is where the expanding ellipse first touches the allowed region.
The diamond has corners sitting on the axes, and an ellipse coming from a typical direction very often hits a corner first. In high dimensions the L1 ball has many corners and edges, so many coefficients end up exactly zero. The ridge disc is round, with no corners to snag on.
Side by side
| Subset (L0) | Ridge (L2) | LASSO (L1) | |
|---|---|---|---|
| Penalty | Number of non-zeros | ||
| Exact zeros? | Yes | No | Yes |
| Closed form? | No (search over subsets) | Yes: | No (iterative) |
| Computation | Very hard () | Easy | Moderate |
| singular / | Subsets still small | Fine | Fine (selects at most variables) |
| Correlated predictors | Picks one arbitrarily | Shares credit | Tends to pick one, drop others (unstable) |
| Interpretability | High | Medium (many small values) | High |
| Coefficient p-values | No convenient test | No convenient test | No convenient test |
Elastic net mixes both penalties: a weight of 0 on the L1 part is ridge, 1 is LASSO, and values in between combine selection with ridge's stability for correlated groups.
"LASSO is a middle ground between best subset and ridge"
Like subset selection it produces sparse models (exact zeros); like ridge it is a continuous shrinkage problem that's cheap to solve. It gets most of subset selection's interpretability without the search.
Cheatsheet
Subset vs ridge vs LASSO
Why LASSO gives zeros
Check your understanding
Score 75% or more to master this lesson and earn XP. Answer first, then check.