Inferensys

Glossary

LASSO (L1 Regularization)

LASSO (Least Absolute Shrinkage and Selection Operator) is a linear regression method that performs both variable selection and regularization by adding a penalty equal to the absolute value of the magnitude of coefficients, shrinking some to exactly zero.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
FEATURE SELECTION

What is LASSO (L1 Regularization)?

LASSO is a linear regression method that performs both variable selection and regularization by adding a penalty equal to the absolute value of the magnitude of coefficients, shrinking some to exactly zero.

The Least Absolute Shrinkage and Selection Operator (LASSO) is an L1-regularized regression technique that adds a penalty term proportional to the sum of the absolute values of the model coefficients. This geometric constraint forces coefficient estimates toward zero, and critically, some coefficients become exactly zero. This automatic variable selection makes LASSO essential for high-dimensional biomarker identification where the number of features (genes, proteins) far exceeds the number of patient samples.

By tuning the regularization hyperparameter lambda, practitioners control the sparsity of the model. A larger lambda increases the penalty, producing a sparser model with fewer selected biomarkers. Unlike ridge regression (L2), which only shrinks coefficients toward zero without eliminating them, LASSO produces inherently interpretable models that directly identify the most predictive molecular features for a given clinical outcome.

L1 REGULARIZATION MECHANICS

Key Characteristics of LASSO

The Least Absolute Shrinkage and Selection Operator (LASSO) is defined by its unique ability to perform continuous shrinkage and automatic variable selection simultaneously. The following cards break down its core mathematical properties, geometric intuition, and practical behavior in high-dimensional biomarker discovery.

01

L1 Penalty and Sparsity

LASSO adds a penalty term equal to λ * Σ|βᵢ| (the sum of absolute coefficient values) to the ordinary least squares loss function. This L1 norm geometry creates a constraint region with sharp corners in parameter space. When the elliptical contours of the residual sum of squares hit these corners, coefficients are driven to exactly zero rather than merely approaching zero asymptotically. This is the fundamental distinction from ridge regression (L2), which only shrinks coefficients toward zero but never eliminates them. The sparsity property makes LASSO inherently a feature selection method, automatically discarding irrelevant predictors.

Exactly Zero
Coefficient Behavior at Corners
02

The Shrinkage Parameter λ

The regularization hyperparameter λ (lambda) controls the strength of the penalty and directly governs model complexity:

  • λ = 0: Reduces to ordinary least squares; all features retained
  • λ → ∞: All coefficients shrink to zero; intercept-only model
  • Intermediate λ: A subset of coefficients become non-zero, with the number selected decreasing as λ increases

Cross-validation is the standard method for selecting an optimal λ, typically using one-standard-error rule to choose the most regularized model within one standard error of the minimum cross-validation error. This yields a more parsimonious model with essentially equivalent predictive performance.

λ = 0
OLS (No Regularization)
λ → ∞
Null Model (All Zero)
03

Bias-Variance Tradeoff

LASSO intentionally introduces bias into coefficient estimates to achieve dramatic reductions in variance. The L1 penalty shrinks coefficient magnitudes away from their unbiased OLS values, but this shrinkage substantially reduces the variance of predictions on new data. The net effect, measured by mean squared error, often favors the biased LASSO estimator over unbiased OLS, particularly when:

  • The number of predictors p is large relative to sample size n
  • Many true coefficients are zero or near-zero (sparse truth)
  • Multicollinearity inflates OLS variance

This tradeoff is the fundamental reason regularization improves generalization in high-dimensional biomarker studies where p >> n.

↓ Variance
Primary Benefit
↑ Bias
Cost of Regularization
04

Limitations with Correlated Features

When predictors are highly correlated, LASSO exhibits selection instability—it tends to arbitrarily select one feature from a correlated group and zero out the others. This behavior arises because the L1 penalty treats each coefficient independently and has no mechanism to enforce group inclusion. In biomarker discovery, this is problematic when:

  • Multiple genes in a pathway are co-expressed and jointly predictive
  • The selected feature may change across different data splits or bootstrap samples
  • Important biological signals distributed across correlated markers are discarded

Elastic Net addresses this limitation by combining L1 and L2 penalties, encouraging grouped selection of correlated features while maintaining sparsity.

Elastic Net
Solution for Correlated Groups
05

Computational Solution Path

LASSO coefficients are typically computed using the LARS (Least Angle Regression) algorithm or coordinate descent. These methods efficiently generate the entire regularization path—the trajectory of all coefficient estimates as λ varies from infinity to zero—at the computational cost of a single OLS fit. Key properties of the solution path:

  • Coefficients enter the model one at a time as λ decreases
  • Once a coefficient becomes non-zero, it may later return to zero
  • The path is piecewise linear, enabling exact computation of coefficient profiles

Modern implementations in glmnet (R) and scikit-learn (Python) use coordinate descent with warm starts and active set strategies for scalability to thousands of features.

Coordinate Descent
Standard Algorithm
Piecewise Linear
Solution Path Property
06

LASSO in Biomarker Discovery

In high-dimensional biomarker studies (e.g., genomics with p > 10,000 and n < 500), LASSO serves as a primary embedded feature selection method integrated directly into model training. Its application includes:

  • Prognostic signature development: Selecting a sparse panel of genes predictive of survival outcomes using Cox-LASSO
  • Diagnostic classifier construction: Building sparse logistic regression models that identify disease status with minimal biomarkers
  • Multi-omics integration: Applying group LASSO variants to select relevant data modalities alongside individual features

A critical consideration: LASSO selects at most n features when p > n, which constrains biomarker panel size in small-sample studies. Post-selection inference methods like selective inference or stability selection are recommended to assess the reliability of selected biomarkers.

≤ n features
Maximum Selection in p > n
Cox-LASSO
Survival Variant
LASSO REGULARIZATION

Frequently Asked Questions

Clear, technically precise answers to the most common questions about L1 regularization, its mechanics, and its role in high-dimensional biomarker discovery.

LASSO, which stands for Least Absolute Shrinkage and Selection Operator, is a linear regression method that performs both regularization and variable selection by adding a penalty equal to the absolute value of the magnitude of coefficients to the ordinary least squares loss function. This L1 penalty forces the sum of the absolute values of the regression coefficients to be less than a fixed tuning parameter, λ (lambda). As λ increases, the optimization process shrinks some coefficients toward zero; critically, due to the geometry of the L1 constraint region—a diamond shape intersecting the elliptical contours of the loss function at axes—some coefficients are driven to exactly zero. This mechanism effectively discards irrelevant features, yielding a sparse model that retains only the most predictive variables. The objective function minimized is:

code
minimize { (1/(2n)) * ||y - Xβ||²₂ + λ * ||β||₁ }

where n is the number of observations, y is the response vector, X is the predictor matrix, β is the coefficient vector, and λ controls the strength of the penalty. This makes LASSO particularly powerful in p >> n scenarios common in genomics, where the number of features far exceeds the number of samples.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.