All labs

LASSO Paths, Cross-Validation, and False Discoveries

Trace coefficients from saturated to empty, then discover that the cross-validated λ is tuned for prediction — not for finding the right variables.

Ch 11 11.3
Explorer
Validation & Feature Selection
25 mindifficulty 4/5

Controls

Regularization

-2

λ = 0.1353 — larger λ means fewer surviving predictors.

Data-generating process

60
30

Try p > n — OLS has no unique solution there, the LASSO still does.

4
1
0.400

Correlated predictors make selection unstable.

Random seed

Every result on this page is a deterministic function of the seed and the controls.

Coefficient paths

Each line is one predictor's coefficient as λ varies. Coloured lines are truly nonzero.

-1012-6-4-20λCV minlog λcoefficient
True signalTrue zeroCV-optimal λ

Cross-validation curve

5-fold mean squared prediction error.

2468-6-4-20λlog λCV MSE

Estimated versus true coefficients

At the current λ.

-10120510152025predictor indexcoefficient
TrueLASSO estimate
λ
0.1353
CV optimum 0.1848
Selected predictors
15
truly nonzero: 4
True positives
4
signals recovered
False positives
11
noise variables selected
Max |shrinkage| on signals
0.573
the LASSO biases nonzero coefficients toward zero
OLS available?
yes, R² 0.921
unique solution exists