Lasso Regularization (L1 Regularization) › Summary
Machine Learning from ScratchAll chapters Lasso Regularization (L1 Regularization) › SummaryOne section · Sections in this chapter10 / 11 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
LASSO (L1) regularization is a technique for building simpler, more interpretable regression models by encouraging sparsity.shrinking some coefficients exactly to zero and thus performing feature selection. The core idea is captured in the summarized form of the LASSO objective, which adds a penalty proportional to the sum of the absolute values of the coefficients, controlled by the regularization parameter .
To make this precise and computationally tractable, we use the matrix form of the objective, as shown above:
where:
- : vector of coefficients to be optimized (including intercept )
- : number of observations in the dataset
- : target vector containing actual values
- : feature matrix (includes column of ones for intercept)
- : regularization parameter in scikit-learn (controls penalty strength)
- : squared L2 (Euclidean) norm of residuals, equal to
- : L1 (Manhattan) norm of coefficients, equal to (intercept not penalized)
This formulation enables efficient computation and connects LASSO to broader optimization theory.
However, unlike ordinary least squares, LASSO does not have a closed-form solution because the L1 penalty makes the problem non-differentiable at zero. This is what allows LASSO to set coefficients exactly to zero, a property that distinguishes it from Ridge (L2) regularization (which we will cover in the next section), which typically only shrinks coefficients but rarely eliminates them.
To solve the LASSO problem, we need iterative optimization algorithms. One such method is the Iterative Shrinkage-Thresholding Algorithm (ISTA), described above. ISTA separates the smooth (least squares) and non-smooth (L1 penalty) parts of the objective, alternating between a gradient step and a soft-thresholding step. This practical algorithm is how we compute the LASSO solution in practice.
In summary: the summarized form tells us the goal, the matrix form gives us a precise and efficient way to express it, and ISTA (or similar algorithms) provides the means to find the solution. Understanding the distinction and relationship between these is key: the forms define what LASSO is optimizing, while ISTA is how we solve it. Choosing the right value of or (often via cross-validation) is important for balancing model simplicity and predictive performance.