Which regularization penalty can push some coefficients of a linear model to exactly zero?
Options
- L2 (ridge)
- Both do it equally
- L1 (lasso) (Correct option)
- Neither: regularization only makes coefficients smaller, never zero
Answer
L1 (lasso)
Why
L1 adds the sum of absolute coefficient values to the loss. Its shape pushes weak features to exactly zero, so it also works as a form of feature selection.
L2 adds the sum of squares. It shrinks all coefficients toward zero but rarely makes them exactly zero.
Elastic net mixes the two.
Remember
L1 gives sparse models; L2 shrinks smoothly.