Cookies on Macro by Mark.We use essential cookies for sign-in, locale, and security. With your permission, we also use optional cookies for preferences, for analytics, and for advertising measurement with the Meta (Facebook) Pixel. Read our cookie policy.
L1-penalized linear regression - drives some coefficients to zero, doing variable selection inside the fit.
Graph workspace
The LASSO path - coefficients plotted against the penalty (or the L1 norm of the coefficient vector) - is the canonical visualization. Unlike ridge's smooth traces, LASSO paths are piecewise linear with sharp kinks where variables enter or leave the active set. The path reveals both the order in which variables become important and their relative magnitudes after selection.
Variables selected at the 1-SE penalty
Number of nonzero coefficients at the penalty chosen on the held-out last third of the sample by the one-standard-error rule (the largest penalty whose validation error is within one standard error of the best). Compare to the true sparsity to assess selection accuracy.
6.00
count
True positive rate
Fraction of truly active variables that LASSO correctly identifies. Ideally 1.0.
1.00
proportion
False discovery rate
Fraction of selected variables that are actually irrelevant. Lower is better.
0.5000
proportion
Prediction MSE
Mean squared prediction error on the held-out last third of the sample, against the observed outcome, at the chosen penalty. The noise variance is its floor, and it is measured on the same split that chose the penalty, so it is slightly optimistic.
1.73
squared units
How many predictors truly affect the outcome; the rest have no real effect.
More active variables produce more paths that separate from zero as decreases. Fewer active variables leave most paths flat at zero.
Predictor correlation: 0.3
How closely the predictors move together; the more alike they are, the shakier the variable picks.
High makes paths wobble and cross. Variables may enter and leave the active set as decreases, visible as paths touching zero then rebounding.
How much random error the data carries; more noise raises the chosen penalty.
Higher moves the one-standard-error choice toward the stronger penalties at the left of the path panel. On this one fixed sample the count of selected variables does not fall steadily with : noise also lets spurious predictors in.
How many observations the model sees; more data helps it find the variables that truly matter.
More data tends to lower the penalty needed and bring the active set closer to the true sparsity. On this one fixed sample the count of selected variables jumps around as n changes, because each n draws different data: at the defaults it runs from 3 to 14.
How large the biggest true effect is; stronger effects are easier to detect.
Larger signals make the active-variable paths separate from zero earlier (at higher ). The gap between true and spurious paths becomes clearer.