2.2.15 · D5Linear & Logistic Regression
Question bank — Elastic Net regularization
Symbols used here (all built in the parent): = the loss we minimize; = the weight vector; = overall regularization strength; = mixing ratio (how much of the penalty is L1 vs L2); = sum of absolute weights; = sum of squared weights; = correlation of feature with the partial residual; = the soft-thresholding operator.
True or false — justify
If a claim is true, say why the mechanism forces it; if false, name the exact step that breaks.
True or false: Setting turns Elastic Net into Lasso.
False. kills the L1 term () and leaves only the L2 term, so you get pure Ridge — which never produces exact zeros. is Lasso.
True or false: Increasing makes the model sparser.
Partly false as stated. Raising increases total shrinkage, but sparsity comes from the L1 threshold ; if no amount of ever zeros a weight. Sparsity needs both and .
True or false: Because linear regression is scale-equivariant, standardizing features before Elastic Net is optional.
False. The penalty is not scale-invariant — and depend on the units of feature . A feature in metres vs kilometres is penalized differently, so you must standardize first.
True or false: and are just two names for the same "penalty knob."
False. sets how much total regularization; sets what flavor (L1-vs-L2 mix). They are orthogonal, which is why you tune them on a 2-D grid.
True or false: With two perfectly correlated features, Lasso and Elastic Net give the same solution.
False. Lasso's objective is flat along the correlated direction, so it picks one champion arbitrarily; Elastic Net's strictly-convex L2 term uniquely prefers equal weights, splitting the load (the grouping effect).
True or false: Elastic Net can select more features than there are training examples ().
True. Unlike pure Lasso (which saturates at selected features), the L2 term lets Elastic Net keep whole correlated groups, so it can retain more than nonzero weights.
True or false: The soft-thresholding operator shrinks small but leaves large untouched.
False. subtracts from every surviving coefficient's magnitude, not just small ones — large still loses . It merely kills the ones with entirely.
True or false: The L2 part of Elastic Net can, on its own, drive a weight to exactly zero.
False. The L2 term enters as division by , a finite positive number — it shrinks proportionally but never reaches exact zero. Only the L1 threshold produces true zeros.
True or false: If , Elastic Net behaves essentially identically to Lasso in every situation.
False. Even a tiny L2 () restores strict convexity along correlated directions, dramatically stabilizing which feature gets selected. Small L2 has an outsized stabilizing effect.
Spot the error
Each statement contains one wrong claim. Find it and correct it.
"The numerator of the update, , is the L2 shrink and the denominator is the L1 shrink."
Reversed. The numerator (thresholding) is the L1 part → sparsity; the denominator (proportional division) is the L2 part → grouping/stability.
"Elastic Net's penalty is ."
The L2 term carries a factor of : it is . The half makes the derivative of the squared term clean ( instead of ), matching the update formula.
"Since L1 gives sparsity, using L1 alone with correlated features is fine — you just keep the best one."
The flaw is 'fine.' L1 alone keeps an arbitrary one and the choice is unstable across resamples, because the objective is flat along . That instability, not the sparsity, is the problem.
"To make Elastic Net select fewer features, raise toward 1 and lower ."
Lowering reduces the threshold , keeping more features. To select fewer, raise and raise (or hold) so the L1 threshold grows.
"The grouping effect comes from L1 being strictly convex."
L1 is not strictly convex — it's flat along sign-matched directions, which is exactly why it fails on groups. The grouping effect comes from L2 being strictly convex and minimized at equal weights.
"Because appears, a feature with can still get a nonzero weight from the L2 term."
No. If then , so , so the numerator is zero and regardless of the L2 denominator. Zero numerator ⇒ zero weight.
Why questions
Answer with the mechanism, not a restatement.
Why does the L1 ball produce sparsity while the L2 ball does not?
The L1 ball has corners on the axes, so the loss contour tends to first touch it at a corner where some coordinates are exactly zero; the L2 ball is round with no corners, so contact points generically have all coordinates nonzero.
Why does adding L2 make the correlated-feature solution unique?
L2 is strictly convex, so becomes strictly convex along the previously-flat direction ; a strictly convex function has exactly one minimizer, eliminating the wobble.
Why do we standardize the assumption before deriving the update?
It removes the coefficient in front of in the derivative, letting the quadratic term simplify to a clean — otherwise each feature's shrink would depend on its own scale.
Why does the update divide by instead of subtracting the L2 penalty?
The L2 term differentiates to , which is proportional to ; solving the linear equation moves it to the denominator, giving a multiplicative (proportional) shrink rather than a fixed subtraction.
Why can't we just average Ridge and Lasso solutions instead of blending their penalties?
The minimizer of a sum of penalties is not the average of the individual minimizers — optimization is nonlinear. Blending the penalties inside one convex objective is what yields the correct joint solution with both sparsity and grouping.
Why is cross-validation, not intuition, recommended for choosing ?
The best depends on the unknown correlation structure and noise level of the data; CV empirically measures generalization across the grid rather than guessing which flavor mix helps.
Edge cases
Push the formula to its boundaries and say what happens.
Edge: . What does Elastic Net reduce to?
The whole penalty vanishes and becomes plain least-squares (OLS) — no shrinkage, no sparsity, and correlated features again cause instability/multicollinearity.
Edge: and . What is ?
The threshold is , so and the denominator is , giving — pure Lasso zeroing with no L2 shrink.
Edge: A feature perfectly uncorrelated with the residual () under any .
, so ; a feature with no relationship to what's left to explain is dropped immediately.
Edge: Two features that are negatively perfectly correlated (). Does grouping still split evenly?
Grouping still stabilizes, but the equal-magnitude split is (equal magnitudes, opposite signs) since that minimizes for the required combined effect; L2 equalizes magnitude, respecting sign structure.
Edge: with a huge . What happens to all weights?
Pure Ridge with strong shrinkage: every weight is divided by a large , so they all shrink toward (but never reach) zero — heavy bias, low variance, no selection.
Edge: A very large that survives the threshold, as .
The L1 subtraction (almost no thresholding), while the L2 denominator dominates — the weight is shrunk almost purely by proportional division, i.e. Ridge-like behavior.
Connections
- Ridge Regression — the boundary probed above.
- Lasso Regression — the boundary probed above.
- Soft-Thresholding Operator — the at the heart of every "spot the error" here.
- Coordinate Descent — where these one-coordinate updates live.
- Feature Correlation & Multicollinearity — the correlated-feature traps target this.
- Bias-Variance Tradeoff — the strong- edge cases are pure bias-variance.
- Cross-Validation — the answer to "why not intuition" for tuning.