Elastic Net mixes L2 (Ridge) and L1 (Lasso) penalties via a mixing parameter α. It handles correlated predictors better than Lasso while still doing feature selection — the best of both worlds.
Lasso (L1 regularisation) is powerful because it drives some coefficients to exactly zero — automatic feature selection. But it has a critical weakness: when features are correlated, Lasso arbitrarily selects one and zeroes the rest, even when they all contribute genuine signal.
The pathological case is when you have more features than samples (d > n). Lasso can select at most n features — it simply can't fit a sparse solution with more coefficients than data points. For genomics data with 20,000 genes and 500 patients, Lasso breaks down.
Elastic Net adds both penalties to the RSS, controlled by two hyperparameters: overall strength λ and mixing ratio α.
Loss = RSS + λ((1-α)·‖β‖2² + α·‖β‖1). When α = 0: pure Ridge. When α = 1: pure Lasso. For 0 < α < 1: Elastic Net. The geometric constraint region is an “elastic ball” — rounder than the L1 diamond but more corner-like than the L2 sphere.
A key advantage of Elastic Net over Lasso: when features are correlated, Elastic Net tends to select them as a group and distribute the coefficient weight among them, rather than arbitrarily zeroing all but one.
Intuition: if features x&sub1; and x&sub2; are perfectly correlated (x&sub1; = x&sub2;), Lasso picks one at random and zeroes the other. Elastic Net puts half the weight on each — a more stable and interpretable solution. This is called the grouping effect.
Because the L1 norm has a non-smooth kink at zero, we use the subgradient of the absolute value: sign(β) for β ≠ 0, any value in [-1,1] for β = 0. In practice, we use the sign function throughout.
Update rule: β ← β - (η/n)(Xᵀ(Xβ - y) + λ(1-α)β + λα sign(β)). The L2 term is smooth (it's just scalar multiplication), while the L1 term uses sign(). Coordinate descent (updating one coefficient at a time with soft-thresholding) is typically faster in practice.
Say the answer out loud before revealing — recalling is what makes it stick. ➜ Next: Multiclass Strategies
What is the Elastic Net loss function and how do α and λ control it?
Why does Lasso fail when features are correlated?
What is the Elastic Net grouping effect?
Why does Elastic Net have no closed-form solution?