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.

Not startedJump to quiz

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.

0OLSβ₂β₁
Ridge (disc): the ellipse touches a smooth boundary, so both coefficients are usually non-zero.
0OLSβ₂ = 0β₂β₁
LASSO (diamond): the ellipse first touches a corner on an axis, where β₂ is exactly 0.

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)
PenaltyNumber of non-zeros
Exact zeros?YesNoYes
Closed form?No (search over subsets)Yes: No (iterative)
ComputationVery hard ()EasyModerate
singular / Subsets still smallFineFine (selects at most variables)
Correlated predictorsPicks one arbitrarilyShares creditTends to pick one, drop others (unstable)
InterpretabilityHighMedium (many small values)High
Coefficient p-valuesNo convenient testNo convenient testNo 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

Zeros: yes / no / yes. Closed form: no / yes / no. Cost: / easy / moderate. Correlated: arbitrary / shares / picks one.

Why LASSO gives zeros

L1 constraint = diamond with corners on the axes; RSS ellipses usually touch a corner first.

See every cheatsheet by category →

Check your understanding

Score 75% or more to master this lesson and earn XP. Answer first, then check.

Q1conceptWhat is the main difference between ridge and LASSO solutions?
Q2conceptGeometrically, why does LASSO give exact zeros?
Q3applyYou have 30 highly correlated predictors that all plausibly contribute a little. Which would you favour?
Q4conceptWhy is LASSO called a middle ground between best subset selection and ridge?
Q5conceptWhat is elastic net?