Lesson 5.5 · 9 min read · about 50 min to master at a very slow pace

LASSO Regression (L1)

LASSO penalises the sum of absolute coefficients, which shrinks some exactly to zero: built-in variable selection. Soft thresholding, a worked comparison with ridge, and when to prefer each.

Not startedJump to quiz

LASSO objective

LASSO = Least Absolute Shrinkage and Selection Operator.

  • Higher : smaller coefficients, higher bias, lower variance, just like ridge.
  • The key difference: LASSO shrinks some coefficients to exactly zero, so it performs variable selection and gives sparse, interpretable models.
  • No closed form: it's solved iteratively (e.g. coordinate descent). Harder than ridge, far easier than best subset.
  • Like ridge, no convenient significance test for coefficients.

Soft thresholding

In the orthonormal case (), with and the objective written as RSS :

-202-3-2-10123OLS coefficient bregularised coefficientLASSO sets these to 0
OLS (no penalty)Ridge, λ = 1: b/2LASSO, λ = 2: threshold 1
Ridge scales every coefficient down. LASSO subtracts a constant and sets small coefficients exactly to zero.

Worked example: ridge vs LASSO on the same OLS coefficients

OLS: , , so the LASSO threshold is .

Ridge: . All non-zero.

LASSO: . The small coefficient becomes exactly 0 (variable dropped); the others shrink by a constant 1.

Ridge or LASSO?

SituationFavour
Many predictors, you believe only a few matter, you want interpretabilityLASSO (sparse)
Many correlated predictors that all plausibly contribute a littleRidge (shares credit, stable)
Groups of correlated predictors and you want selectionElastic net (a mix of both)

LASSO with correlated predictors

Among highly correlated predictors LASSO tends to pick one and drop the rest, somewhat arbitrarily; which one can change with a small change in the data. Don't read a dropped variable as "irrelevant", and never describe LASSO-selected variables as "the causes".

Cheatsheet

LASSO

. Orthonormal: (soft threshold).

Ridge vs LASSO in one line

Ridge divides (never zero); LASSO subtracts (exact zeros → selection).

See every cheatsheet by category →

Check your understanding

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

Q1calculateOrthonormal design with OLS coefficients . What does LASSO give with threshold ?
Q2calculateSame OLS coefficients , orthonormal design. What does ridge give with ?
Q3applyYou have 500 predictors, believe only about 10 matter, and need an interpretable model. Ridge or LASSO?
Q4interpretAs increases in LASSO, what typically happens?
Q5applyTwo predictors are almost exact copies of each other. What does LASSO tend to do with them?