Also known as least absoute shrinkage and selection operator, LASSO, lasso method
Article
In statistics and machine learning, lasso (least absolute shrinkage and selection operator; also Lasso, LASSO or L1 regularization) is a regression analysis method that performs both variable selection and regularization in order to enhance the prediction accuracy and interpretability of the resulting statistical model. The lasso method assumes that the coefficients of the linear model are sparse, meaning that few of them are non-zero. It was originally introduced in geophysics, and later by Robert Tibshirani, who coined the term.
Lasso was originally formulated for linear regression models. This simple case reveals a substantial amount about the estimator. These include its relationship to ridge regression and best subset selection and the connections between lasso coefficient estimates and so-called soft thresholding. It also reveals that (like standard linear regression) the coefficient estimates do not need to be unique if covariates are collinear.
Though originally defined for linear regression, lasso regularization is easily extended to other statistical models including generalized linear models, generalized estimating equations, proportional hazards models, and M-estimators. Lasso's ability to perform subset selection relies on the form of the constraint and has a variety of interpretations including in terms of geometry, Bayesian statistics and convex analysis.
The LASSO is closely related to basis pursuit denoising.
Contents
History
Lasso was introduced in order to improve the prediction accuracy and interpretability of regression models. It selects a reduced set of the known covariates for use in a model.
Lasso was developed independently in geophysics literature in 1986, based on prior work that used the
ℓ
1
{\displaystyle \ell ^{1}}
penalty for both fitting and penalization of the coefficients. Statistician Robert Tibshirani independently rediscovered and popularized it in 1996, based on Breiman's nonnegative garrote.
Prior to lasso, the most widely used method for choosing covariates was stepwise selection. That approach only improves prediction accuracy in certain cases, such as when only a few covariates have a strong relationship with the outcome. However, in other cases, it can increase prediction error.
At the time, ridge regression was the most popular technique for improving prediction accuracy. Ridge regression improves prediction error by shrinking the sum of the squares of the regression coefficients to be less than a fixed value in order to reduce overfitting, but it does not perform covariate selection and therefore does not help to make the model more interpretable.
Lasso achieves both of these goals by forcing the sum of the absolute value of the regression coefficients to be less than a fixed value, which forces certain coefficients to zero, excluding them from impacting prediction. This idea is similar to ridge regression, which also shrinks the size of the coefficients; however, ridge regression does not set coefficients to zero (and, thus, does not perform variable selection).
Basic form
Least squares
Consider a sample consisting of N cases, each of which consists of p covariates and a single outcome. Let
then using subgradient methods it can be shown that
β
^
j
Correlated covariates
In one special case two covariates, say j and k, are identical for each observation, so that
x
(
j
)
=
x
(
k
)
{\displaystyle x_{(j)}=x_{(k)}}
, where
x
(
j
)
,
i
=
x
(
k
)
,
i
{\displaystyle x_{(j),i}=x_{(k),i}}
. Then the values of
β
j
{\displaystyle \beta _{j}}
and
β
k
{\displaystyle \beta _{k}}
General form
Lasso regularization can be extended to other objective functions such as those for generalized linear models, generalized estimating equations, proportional hazards models, and M-estimators. Given the objective function
the lasso regularized version of the estimator s the solution to
min
α
,
β
1
N
∑
i
=
1
Interpretations
Geometric interpretation
Lasso can set coefficients to zero, while the superficially similar ridge regression cannot. This is due to the difference in the shape of their constraint boundaries. Both lasso and ridge regression can be interpreted as minimizing the same objective function
Making λ easier to interpret with an accuracy-simplicity tradeoff
The lasso can be rescaled so that it becomes easy to anticipate and influence the degree of shrinkage associated with a given value of
λ
{\displaystyle \lambda }
. It is assumed that
X
{\displaystyle X}
is standardized with z-scores and that
y
{\displaystyle y}
is centered (zero mean). Let
β
0
{\displaystyle \beta _{0}}
represent the hypothesized regression coefficients and let
b
OLS
{\displaystyle b_{\text{OLS}}}
refer to the data-optimized ordinary least squares solutions. We can then define the Lagrangian as a tradeoff between the in-sample accuracy of the data-optimized solutions and the simplicity of sticking to the hypothesized values. This results in
min
β
∈
R
p
{
Bayesian interpretation
Just as ridge regression can be interpreted as linear regression for which the coefficients have been assigned normal prior distributions, lasso can be interpreted as linear regression for which the coefficients have Laplace prior distributions. The Laplace distribution is sharply peaked at zero (its first derivative is discontinuous at zero) and it concentrates its probability mass closer to zero than does the normal distribution. This provides an alternative explanation of why lasso tends to set some coefficients to zero, while ridge regression does not.
Convex relaxation interpretation
Lasso can also be viewed as a convex relaxation of the best subset selection regression problem, which is to find the subset of
≤
k
{\displaystyle \leq k}
covariates that results in the smallest value of the objective function for some fixed
k
≤
n
{\displaystyle k\leq n}
, where n is the total number of covariates. The "
ℓ
0
{\displaystyle \ell ^{0}}
norm",
‖
⋅
‖
0
{\displaystyle \|\cdot \|_{0}}
, (the number of nonzero entries of a vector), is the limiting case of "
ℓ
p
{\displaystyle \ell ^{p}}
norms", of the form
‖
x
‖
Prediction error guarantees
Theoretical guarantees for the lasso include bounds on its prediction error in high-dimensional regression, where the number of covariates can exceed the sample size. For a fixed design matrix
X
{\displaystyle X}
, consider the linear model
y
=
X
β
⋆
+
ε
{\displaystyle y=X\beta ^{\star }+\varepsilon }
, with
n
{\displaystyle n}
observations,
p
{\displaystyle p}
covariates and independent Gaussian errors of variance
σ
2
{\displaystyle \sigma ^{2}}
. Bickel, Ritov and Tsybakov established prediction-error bounds under a restricted eigenvalue condition on the design matrix. If
β
⋆
{\displaystyle \beta ^{\star }}
Generalizations
Lasso variants have been created in order to remedy limitations of the original technique and to make the method more useful for particular problems. Almost all of these focus on respecting or exploiting dependencies among the covariates.
Elastic net regularization adds an additional ridge regression-like penalty that improves performance when the number of predictors is larger than the sample size, allows the method to select strongly correlated variables together, and improves overall prediction accuracy.
Group lasso allows groups of related covariates to be selected as a single unit, which can be useful in settings where it does not make sense to include some covariates without others. Further extensions of group lasso perform variable selection within individual groups (sparse group lasso) and allow overlap between groups (overlap group lasso).
Fused lasso can account for the spatial or temporal characteristics of a problem, resulting in estimates that better match system structure. Lasso-regularized models can be fit using techniques including subgradient methods, least-angle regression (LARS), and proximal gradient methods. Determining the optimal value for the regularization parameter is an important part of ensuring that the model performs well; it is typically chosen using cross-validation.
Elastic net
In 2005, Zou and Hastie introduced the elastic net. When p > n (the number of covariates is greater than the sample size) lasso can select only n covariates (even when more are associated with the outcome) and it tends to select one covariate from any set of highly correlated covariates. Additionally, even when n > p, ridge regression tends to perform better given strongly correlated covariates.
The elastic net extends lasso by adding an additional
ℓ
2
{\displaystyle \ell ^{2}}
penalty term giving
min
β
∈
R
p
{
‖
y
−
X
β
‖
2
2
+
λ
1
‖
β
‖
1
+
λ
2
‖
Group lasso
In 2006, Yuan and Lin introduced the group lasso to allow predefined groups of covariates to jointly be selected into or out of a model. This is useful in many settings, perhaps most obviously when a categorical variable is coded as a collection of binary covariates. In this case, group lasso can ensure that all the variables encoding the categorical covariate are included or excluded together. Another setting in which grouping is natural is in biological studies. Since genes and proteins often lie in known pathways, which pathways are related to an outcome may be more significant than whether individual genes are. The objective function for the group lasso is a natural generalization of the standard lasso objective
min
β
∈
R
p
{
‖
y
−
∑
j
=
1
J
X
j
β
j
‖
2
2
+
λ
∑
j
=
1
J
Fused lasso
In some cases, the phenomenon under study may have important spatial or temporal structure that must be considered during analysis, such as time series or image-based data. In 2005, Tibshirani and colleagues introduced the fused lasso to extend the use of lasso to this type of data. The fused lasso objective function is
min
β
{
1
N
∑
i
=
1
N
(
y
i
−
x
i
⊺
β
)
2
}
subject to
∑
j
=
1
p
|
β
j
|
≤
t
Quasi-norms and bridge regression
Lasso, elastic net, group and fused lasso construct the penalty functions from the
ℓ
1
{\displaystyle \ell ^{1}}
and
ℓ
2
{\displaystyle \ell ^{2}}
norms (with weights, if necessary). The bridge regression utilises general
ℓ
p
{\displaystyle \ell ^{p}}
norms (
p
≥
1
{\displaystyle p\geq 1}
) and quasinorms (
0
<
p
<
1
{\displaystyle 0<p<1}
). For example, for p=1/2 the analogue of lasso objective in the Lagrangian form is to solve
min
β
∈
R
Adaptive lasso
The adaptive lasso was introduced by Zou in 2006 for linear regression and by Zhang and Lu in 2007 for proportional hazards regression.
Prior lasso
The prior lasso was introduced for generalized linear models by Jiang et al. in 2016 to incorporate prior information, such as the importance of certain covariates. In prior lasso, such information is summarized into pseudo responses (called prior responses)
y
^
p
{\displaystyle {\hat {y}}^{\mathrm {p} }}
and then an additional criterion function is added to the usual objective function with a lasso penalty. Without loss of generality, in linear regression, the new objective function can be written as
min
β
∈
R
p
{
1
N
‖
y
−
X
β
‖
2
2
+
1
N
η
‖
y
^
p
−
Ensemble lasso
Lasso can be run in an ensemble. This can be especially useful when the data is high-dimensional. The procedure involves running lasso on each of several random subsets of the data and collating the results.
Computing lasso solutions
The loss function of the lasso is not differentiable, but a wide variety of techniques from convex analysis and optimization theory have been developed to compute the solutions path of the lasso. These include coordinate descent, subgradient methods, least-angle regression (LARS), and proximal gradient methods. Subgradient methods are the natural generalization of traditional methods such as gradient descent and stochastic gradient descent to the case in which the objective function is not differentiable at all points. LARS is a method that is closely tied to lasso models, and in many cases allows them to be fit efficiently, though it may not perform well in all circumstances. LARS generates complete solution paths. Proximal methods have become popular because of their flexibility and performance and are an area of active research. The choice of method will depend on the particular lasso variant, the data and the available resources. However, proximal methods generally perform well.
The "glmnet" package in R, where "glm" is a reference to "generalized linear models" and "net" refers to the "net" from "elastic net" provides an extremely efficient way to implement LASSO and some of its variants.
The "celer" package in Python provides a highly efficient solver for the Lasso problem, often outperforming traditional solvers like scikit-learn by up to 100 times in certain scenarios, particularly with high-dimensional datasets. This package leverages dual extrapolation techniques to achieve its performance gains. The celer package is available at GitHub.
Choice of regularization parameter
Choosing the regularization parameter (
λ
{\displaystyle \lambda }
) is a fundamental part of lasso. A good value is essential to the performance of lasso since it controls the strength of shrinkage and variable selection, which, in moderation can improve both prediction accuracy and interpretability. However, if the regularization becomes too strong, important variables may be omitted and coefficients may be shrunk excessively, which can harm both predictive capacity and inferencing. Cross-validation is often used to find the regularization parameter.
Information criteria such as the Bayesian information criterion (BIC) and the Akaike information criterion (AIC) might be preferable to cross-validation, because they are faster to compute and their performance is less volatile in small samples. An information criterion selects the estimator's regularization parameter by maximizing a model's in-sample accuracy while penalizing its effective number of parameters/degrees of freedom. Zou et al. proposed to measure the effective degrees of freedom by counting the number of parameters that deviate from zero. The degrees of freedom approach was considered flawed by Kaufman and Rosset and Janson et al., because a model's degrees of freedom might increase even when it is penalized harder by the regularization parameter. As an alternative, the relative simplicity measure defined above can be used to count the effective number of parameters. For the lasso, this measure is given by
P
^
=
∑
i
=
1
p
|
β
i
Selected applications
LASSO has been applied in economics and finance, and was found to improve prediction and to select sometimes neglected variables, for example in corporate bankruptcy prediction literature, or high growth firms prediction.
Article from Wikipedia (CC BY-SA 4.0), where it is maintained by volunteer editors.
is referred to as the soft thresholding operator, since it translates values towards zero (making them exactly zero in the limit as they themselves approach zero) instead of setting smaller values to zero and leaving larger ones untouched as the hard thresholding operator, often denoted
is an indicator function (it is 1 if its argument is true and 0 otherwise).
Therefore, the lasso estimates share features of both ridge and best subset selection regression since they both shrink the magnitude of all the coefficients, like ridge regression and set some of them to zero, as in the best subset selection case. Additionally, while ridge regression scales all of the coefficients by a constant factor, lasso instead translates the coefficients towards zero by a constant value and sets them to zero if they reach it.
that minimize the lasso objective function are not uniquely determined. In fact, if some
fixed, gives a new solution, so the lasso objective function then has a continuum of valid minimizers. Several variants of the lasso, including the Elastic net regularization, have been designed to address this shortcoming.
for ridge. The figure shows that the constraint region defined by the
ℓ
1
{\displaystyle \ell ^{1}}
norm is a square rotated so that its corners lie on the axes (in general a cross-polytope), while the region defined by the
ℓ
2
{\displaystyle \ell ^{2}}
norm is a circle (in general an n-sphere), which is rotationally invariant and, therefore, has no corners. As seen in the figure, a convex object that lies tangent to the boundary, such as the line shown, is likely to encounter a corner (or a higher-dimensional equivalent) of a hypercube, for which some components of
β
{\displaystyle \beta }
are identically zero, while in the case of an n-sphere, the points on the boundary for which some of the components of
β
{\displaystyle \beta }
are zero are not distinguished from the others and the convex object is no more likely to contact a point at which some components of
is specified below and the "prime" symbol stands for transpose. The first fraction represents relative accuracy, the second fraction relative simplicity, and
λ
{\displaystyle \lambda }
balances between the two.
Given a single regressor, relative simplicity can be defined by specifying
. In other words, the inclusion of irrelevant regressors delays the moment that relevant regressors are activated by this rescaled lasso. The adaptive lasso and the lasso are special cases of a '1ASTc' estimator. The latter only groups parameters together if the absolute correlation among regressors is larger than a user-specified value.
(where the quotation marks signify that these are not really norms for
p
<
1
{\displaystyle p<1}
since
‖
⋅
‖
p
{\displaystyle \|\cdot \|_{p}}
is not convex for
p
<
1
{\displaystyle p<1}
, so the triangle inequality does not hold). Therefore, since p = 1 is the smallest value for which the "
ℓ
p
{\displaystyle \ell ^{p}}
norm" is convex (and therefore actually a norm), lasso is, in some sense, the best convex approximation to the best subset selection problem, since the region defined by
‖
x
‖
1
≤
t
{\displaystyle \|x\|_{1}\leq t}
is the convex hull of the region defined by
‖
x
‖
p
≤
t
{\displaystyle \|x\|_{p}\leq t}
for
p
<
1
{\displaystyle p<1}
.
has at most
s
{\displaystyle s}
nonzero coefficients, the columns of
X
{\displaystyle X}
are normalized and the regularization parameter is suitably chosen, their results give, with high probability,
depends on the restricted eigenvalue bound and the tuning constant. The restricted eigenvalue condition controls the design matrix on a restricted set of coefficient directions and does not require
X
T
X
{\displaystyle X^{\mathsf {T}}X}
to be invertible.
Prediction guarantees can also take the form of oracle inequalities, which compare the lasso's error with the approximation error of a sparse linear predictor plus a term accounting for estimation error. Koltchinskii, Lounici and Tsybakov proved a sharp oracle inequality for the fixed-design lasso under a restricted eigenvalue condition. Here, sharp means that the coefficient multiplying the approximation-error term is exactly one. Their bound therefore allows comparison with sparse approximations even when the underlying coefficient vector is not itself sparse.
For random designs, prediction on new observations is measured by an error averaged over the distribution of the covariates, rather than only over the observed design points. Bellec, Dalalyan, Grappin and Paris studied adaptations of the lasso to semi-supervised and transductive learning, in which additional covariate observations are available without response labels. Under boundedness and appropriate design conditions, they established oracle inequalities both with high probability and in expectation. Their analysis shows how unlabeled observations can improve estimation of the covariate covariance matrix and relax the conditions needed for fast prediction rates. The paper also reviews earlier results on prediction error for the lasso with random designs.
Therefore, highly correlated covariates tend to have similar regression coefficients, with the degree of similarity depending on both
‖
y
‖
1
{\displaystyle \|y\|_{1}}
and
λ
2
{\displaystyle \lambda _{2}}
, which is different from lasso. This phenomenon, in which strongly correlated covariates have similar regression coefficients, is referred to as the grouping effect. Grouping is desirable since, in applications such as tying genes to a disease, finding all the associated covariates is preferable, rather than selecting one from each set of correlated covariates, as lasso often does. In addition, selecting only one from each group typically results in increased prediction error, since the model is less robust (which is why ridge regression often outperforms lasso).
have been replaced by a collection of design matrices
X
j
{\displaystyle X_{j}}
and covariate vectors
β
j
{\displaystyle \beta _{j}}
, one for each of the J groups. Additionally, the penalty term is now a sum over
ℓ
2
{\displaystyle \ell ^{2}}
norms defined by the positive definite matrices
K
j
{\displaystyle K_{j}}
. If each covariate is in its own group and
K
j
=
I
{\displaystyle K_{j}=I}
, then this reduces to the standard lasso, while if there is only a single group and
K
1
=
I
{\displaystyle K_{1}=I}
, it reduces to ridge regression. Since the penalty reduces to an
ℓ
2
{\displaystyle \ell ^{2}}
norm on the subspaces defined by each group, it cannot select out only some of the covariates from a group, just as ridge regression cannot. However, because the penalty is the sum over the different subspace norms, as in the standard lasso, the constraint has some non-differential points, which correspond to some subspaces being identically zero. Therefore, it can set the coefficient vectors corresponding to some subspaces to zero, while only shrinking others. However, it is possible to extend the group lasso to the so-called sparse group lasso, which can select individual covariates within a group, by adding an additional
ℓ
1
{\displaystyle \ell ^{1}}
penalty to each group subspace. Another extension, group lasso with overlap allows covariates to be shared across groups, e.g., if a gene were to occur in two pathways.
The "gglasso" package by in R, allows for fast and efficient implementation of Group LASSO.
The first constraint is the lasso constraint, while the second directly penalizes large changes with respect to the temporal or spatial structure, which forces the coefficients to vary smoothly to reflect the system's underlying logic. Clustered lasso is a generalization of fused lasso that identifies and groups relevant covariates based on their effects (coefficients). The basic idea is to penalize the differences between the coefficients so that nonzero ones cluster. This can be modeled using the following regularization:
) provide more meaningful results in data analysis both theoretically and empirically. The non-convexity of these quasi-norms complicates the optimization problem. To solve this problem, an expectation-minimization procedure is developed and implemented for minimization of function
(called the adjusted response values by the prior information).
In prior lasso, the parameter
η
{\displaystyle \eta }
is called a balancing parameter, in that it balances the relative importance of the data and the prior information. In the extreme case of
η
=
0
{\displaystyle \eta =0}
, prior lasso is reduced to lasso. If
η
=
∞
{\displaystyle \eta =\infty }
, prior lasso will solely rely on the prior information to fit the model. Furthermore, the balancing parameter
η
{\displaystyle \eta }
has another appealing interpretation: it controls the variance of
β
{\displaystyle \beta }
in its prior distribution from a Bayesian viewpoint.
Prior lasso is more efficient in parameter estimation and prediction (with a smaller estimation error and prediction error) when the prior information is of high quality, and is robust to the low quality prior information with a good choice of the balancing parameter
In statistics and machine learning, lasso is a regression analysis method that performs both variable selection and regularization in order to enhance the prediction accuracy and interpretability of the resulting statistical model. The lasso method assumes that the coefficients of the linear model are sparse, meaning that few of them are non-zero. It was originally introduced in geophysics, and later by Robert Tibshirani, who coined the term.