Compute the L1 or L2 penalty added to the loss from your weights and regularization strength, and compare Lasso sparsity with Ridge shrinkage.
L1 产生稀疏权重,L2 使权重平滑。
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Norm definition | the L1 norm sums absolute values while the L2 norm is the square root of squared values | Golub & Van Loan, Matrix Computations |
| Geometry | L1 level sets are diamonds while L2 level sets are circles | Hastie et al., Elements of Statistical Learning |
| Use case | L1 suits feature selection whereas L2 suits collinear predictors | Tibshirani 1996, JRSS-B |