AI Glossary / Probabilistic machine learning / Intermediate
Regularization path
Definition
A regularization path is the sequence of fitted model solutions obtained as the strength of a regularization penalty varies. It shows how coefficients, predictions, or model complexity change between stronger and weaker regularization, rather than presenting only one selected fit.
What it means
Regularization balances fit to observed data against a preference such as smaller coefficients or fewer active predictors. The path makes that tradeoff visible. Each position corresponds to a different optimization problem with a different penalty weight, usually called lambda.
A path is not the history of optimizer iterations for one fixed lambda. It is a family of solutions across lambda values. Inspecting this family can reveal sensitivity, but choosing a deployed model still requires an evaluation rule, domain constraints, and a clear understanding of how the penalty was defined.
How it works
Start with an objective such as training loss plus lambda times a penalty. Choose a range of lambda values and solve the corresponding problems. Many implementations work from strong to weak regularization, using one solution to initialize the next; this warm start can reduce computation.
For squared-error lasso regression, paths have a piecewise-linear structure under the usual formulation. Other penalties or losses need not share that geometry. Software often returns a finite grid of fitted solutions rather than a symbolic description of every possible lambda.
Plot coefficients or validation performance against a clearly labeled axis, such as lambda or log(lambda). Feature scaling, loss normalization, intercept handling, and penalty weights affect the meaning of the path. A numerical lambda from one implementation may not mean the same strength in another.
Three practical examples
- Feature selection: an analyst examines which predictors enter a lasso model as regularization weakens and whether small changes in lambda cause major changes in the selected set.
- Forecasting: a team compares validation errors along a ridge path and chooses a penalty using time-respecting validation rather than training error alone.
- Model review: stakeholders inspect a simpler and a more complex candidate from the same path to understand how predictive behavior and maintenance requirements differ.
Think of it this way
Think of adjusting a restraint on a flexible shape. A tight setting allows little movement; a loose setting allows the shape to follow more detail. A regularization path records the shapes at different settings. The analogy does not imply that every coefficient moves monotonically or that the loosest shape best describes future data.
Worked example
Consider an original two-coefficient example with objective J(beta) = 0.5[(beta_1 - 4)^2 + (beta_2 + 1)^2] + lambda(|beta_1| + |beta_2|). This deliberately separable objective corresponds to a simple orthonormal-design setting with a specified loss scale.
Its lasso solution uses soft thresholding: beta_1 = max(4 - lambda, 0) and beta_2 = -max(1 - lambda, 0). At lambda = 5, the solution is (0, 0). At lambda = 2, it is (2, 0). At lambda = 0.5, it is (3.5, -0.5). At lambda = 0, it is (4, -1).
The second coefficient becomes nonzero only when lambda falls below 1. That threshold belongs to this particular objective and feature scaling; it is not a universal significance cutoff.
Now replace the lasso term with (lambda/2)(beta_1^2 + beta_2^2). The ridge solution is (4/(1 + lambda), -1/(1 + lambda)). At lambda = 2, this is (4/3, -1/3): both coefficients remain nonzero. The two paths illustrate different penalties, not evidence that either one predicts better. A separate validation dataset is needed for that comparison.
Illustrative case study
In a fictional project, Rowan Services builds a model for weekly workload. The team initially selects the weakest penalty because it gives the lowest training error. A review of forward-in-time validation shows that this choice is unstable when staffing patterns change.
The analysts compare errors along the path, inspect coefficient changes, and select a candidate using a rule agreed before reviewing the final test period. They retain the full preprocessing recipe so that later retraining uses the same feature definitions. The case illustrates disciplined model selection rather than suggesting that a particular path shape guarantees operational success.
Common misconceptions and mistakes
A coefficient entering early is not proof of causal importance. Correlated predictors can compete, and lasso coefficients can change direction or leave the active set along a general path. The orderly thresholds in the worked example rely on its separable structure.
A coefficient path is also not a confidence interval. Selecting lambda on the test set leaks evaluation information into model choice. Another mistake is comparing lambda values after changing the scale of the loss, sample weights, or predictors without accounting for the change. Strong regularization can underfit; weak regularization can fit noise.
Business use
Use paths to make model-selection tradeoffs reviewable. State the penalty, lambda range, preprocessing, and selection criterion. Evaluate the chosen approach with splits that reflect deployment, such as grouped or chronological splits where appropriate. Fit data-dependent preprocessing within each training split.
If several candidates perform similarly, compare stability, feature availability, cost, and interpretability. Keep the final test set for assessing the selected procedure. Record both the chosen lambda and the complete objective convention so that another team can reproduce the result rather than merely copy a number.
People also ask
Is the regularization path one model or many?
It is a family of fitted models indexed by penalty strength, often represented by a finite grid.
Does the path choose lambda automatically?
No. Cross-validation or another explicit rule can select a point from it.
Is the path always piecewise linear?
No. That property applies to particular formulations, including the familiar squared-error lasso path, and should not be generalized to every regularized model.
Check your understanding
In the lasso example, what happens to beta_2 at lambda = 1.5, and would the same conclusion hold for ridge?
Answer: Lasso sets beta_2 to zero because 1.5 exceeds its threshold of 1. Ridge instead gives beta_2 = -1/2.5 = -0.4 under the stated objective.
Related terms
- Regularization
- Lasso
- Ridge regression
- Elastic-Net
- Cross-validation
- Model selection
- penalty parameter
- warm start
- coefficient shrinkage
- soft thresholding
Learn next
Plot both analytic paths from the example using the same lambda axis. Then introduce correlated predictors in a numerical example and compare coefficient behavior with predictive performance on held-out data.
More in Probabilistic machine learning
- Recurrent state space model - A recurrent state space model is a learned sequence model that combines a deterministic recurrent memory with a stochastic latent state.
- Recursive least squares - Recursive least squares is an algorithm for updating a least-squares parameter estimate as new observations arrive.
- Reference prior - A reference prior is a prior distribution constructed by a formal information-based procedure to provide a baseline Bayesian analysis for a specified...
- Regularized discriminant analysis - Regularized discriminant analysis is a classification approach that stabilizes estimated class covariance matrices through shrinkage.
- REINFORCE - REINFORCE is a family of stochastic gradient methods that adjusts a policy using sampled rewards or returns multiplied by the gradient of the log...
- Representational similarity analysis - Representational similarity analysis compares how different systems distinguish the same set of items or conditions.
Sources
Friedman, Hastie and Tibshirani, Regularization Paths for Generalized Linear Models via Coordinate Descent, original article: https://www.jstatsoft.org/article/view/v033i01 Glmnet authors, official introduction, objective conventions, coefficient paths, and cross-validation: https://glmnet.stanford.edu/articles/glmnet.html The author manuscript Sections 1–2 was independently consulted at https://pmc.ncbi.nlm.nih.gov/articles/PMC2929880/ ; the glmnet introduction timed out.
Previous: Regularization function Next: Regularization rate