difficulty 4/5
Elastic Net
Linear regression penalised by a weighted blend of the L1 and L2 terms — it selects features like Lasso while keeping correlated groups together like Ridge.
Intuition
Lasso and Ridge each fail in the other's strong case. Lasso gives you a short, readable model but behaves erratically when features are correlated — it keeps one of a group and discards its near-twins, and which one it keeps can change between refits. Ridge is stable under correlation but never removes anything.
Elastic Net carries both penalties at once and lets you set the mix. The L1 part still zeroes out coefficients; the L2 part stops the selection from being a coin-flip among correlated features.
Formal definition
How it works
Where it's used
Why & when
Worked example
Pitfalls
Check yourself
3 questions
The questions on this page come with access. They are graded on the server, so the answers stay there until you have given yours.
On the cheat sheet: Linear models →
Sources
- scikit-learn — sklearn.linear_model.ElasticNetdocs · retrieved 2026-08-31https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.ElasticNet.html
- Deep Learning (2016)book · retrieved 2026-10-07https://www.deeplearningbook.org/contents/regularization.html
- scikit-learn user guide — Linear Modelsdocs · retrieved 2026-10-07https://scikit-learn.org/stable/modules/linear_model.html