What is Elastic Net regression?
Elastic Net regression is a regularized linear regression method that combines the L1 penalty of Lasso with the L2 penalty of Ridge regression.
It is useful when you want both coefficient shrinkage and feature selection, especially when many predictors are correlated.
Core idea
Elastic Net minimizes a loss that includes:
Prediction error + L1 penalty + L2 penaltyA common form is:
Sum of Squared Residuals
+ λ1 × Σ|bj|
+ λ2 × Σ(bj²)where:
bjare the feature coefficients- the L1 term can push some coefficients exactly to zero
- the L2 term shrinks coefficients and improves stability
Why combine Lasso and Ridge?
Lasso is useful for feature selection because it can remove features by setting their coefficients to zero.
Ridge is useful when predictors are strongly correlated because it tends to distribute weight more smoothly across them.
Elastic Net combines both behaviors.
What happens with correlated features?
When several predictors contain similar information, Lasso may keep one and remove the others.
Elastic Net is often more stable because the Ridge component encourages correlated predictors to share influence rather than forcing the model to choose only one.
How is the balance controlled?
Implementations commonly use:
- an overall regularization strength
- a mixing parameter that controls the balance between L1 and L2
For example:
- more L1 behavior means more coefficients may become zero
- more L2 behavior means stronger coefficient shrinkage without as much feature removal
The best values are usually selected with validation or cross-validation.
Feature scaling matters
Elastic Net penalizes coefficient sizes, so numerical features should generally be placed on comparable scales before fitting the model.
Otherwise, features measured in different units may be penalized unevenly.
When is Elastic Net useful?
It is particularly useful when:
- there are many input features
- some features are irrelevant
- groups of predictors are highly correlated
- you want a simpler model without relying entirely on Lasso's feature-selection behavior
In short, Elastic Net combines L1 and L2 regularization so it can both shrink coefficients and remove some features while remaining more stable when predictors are correlated.
Learning Sequence
Machine Learning Curriculum
Explore Related Questions
Deepen your understanding across related Machine Learning topics.