liveBook · Manning

L1 regularization

As explained in Ensemble Methods for Machine Learning

L1 regularization penalizes the sum of absolute parameter values to constrain a model and encourage sparse parameters.

L1 regularization adds the sum of absolute parameter values to the squared-loss objective. Increasing this penalty shrinks weights and can drive some exactly to zero, producing a sparse model with implicit feature selection. section 7.1.1

A useful diagnostic is a regression problem with highly correlated features. Compared with OLS, LASSO can discard one feature while retaining predictive performance, whereas ridge shrinks correlated weights without necessarily eliminating them.

LASSO on correlated features

Split the two-feature dataset into training and test sets, fit Lasso(alpha=0.5), then evaluate MSE and mean absolute error. The displayed model learns coefficients [-0.0, -0.79809073], setting one coefficient to zero; its test MSE is 2.832 and MAD is 1.304.

How Ensemble Methods for Machine Learning covers it

How deep it goes
Defines the absolute-value penalty and demonstrates its coefficient effect, but does not derive optimization internals.
Examples
Uses synthetic noisy data with two highly correlated features and compares coefficients, MSE, and mean absolute deviation.
What you can do after
Apply it via scikit-learn's Lasso estimator and evaluate predictions with MSE and mean absolute error.
How it connects
Contrasts LASSO with ordinary least squares, ridge regression, and elastic net through shared squared-loss regression.

Also explained in

Compare how 6 books explain L1 regularization →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Ensemble Methods for Machine Learning. The section links point to the parts of the book it draws on.