One Coordinate Drops Out
Solve a two-feature orthogonal Lasso problem and watch the weaker coordinate hit exact zero on the corner of the L1 diamond while the stronger coordinate survives.
The problem
With two zero-intercept features , the Lasso objective is . Whenever the columns are orthogonal (), the cross term vanishes and splits into two separate 1D problems using and :
Why does one coordinate drop out completely while the other stays active? In the plane, the L1 budget is a diamond whose sharp corners sit directly on the coordinate axes and . Expanding elliptical error contours centered at hit an axis corner whenever , setting while .
Work through the numbers
Take the four-row [x_1, x_2, y] table (1, 1, 3.5), (1, -1, 2.5), (-1, 1, -2.5), and (-1, -1, -3.5) at lam = 2.5.
Verify orthogonality and column norms first: , , and . Compute correlations with : and , giving .
Now apply lam = 2.5, which sits strictly between and :
- Feature survives: .
- Feature drops out: , giving
[2.375, 0.0].
Check why nudging off zero loses on the objective: raising from to reduces by , whereas charges , a net penalty loss of .
The live model
The left panel plots the plane with the orange L1 diamond passing through [w_1, w_2] (green) and (gray); the right panel traces the piecewise-linear paths and with a red cursor at lam. Slide lam across 2.0: hits the horizontal axis at lam = 2.0 and stays flat at 0.0 while keeps descending linearly toward lam = 12.0.

let lam = scene.parameter("lam", 2.5, 0.0, 13.0, 0.5);
let x1 = input.select(1, 0);
let x2 = input.select(1, 1);
let ys = input.select(1, 2);
let s1 = x1.square().sum();
let s2 = x2.square().sum();
let c1 = (x1 * ys).sum();
let c2 = (x2 * ys).sum();
let w1 = (c1.sign() * (c1.abs() - lam).relu()).div(s1);
let w2 = (c2.sign() * (c2.abs() - lam).relu()).div(s2);
let c_pair = torch.list().add(c1.reshape(1)).add(c2.reshape(1));
let corrs = torch.cat(c_pair, 0);
let w_pair = torch.list().add(w1.reshape(1)).add(w2.reshape(1));
let answer = torch.cat(w_pair, 0);
out.set("corrs", corrs).set("weights", answer);
{
"corrs": [
12,
2
],
"weights": [
2.375,
0
]
}Your turn
Compute [w_1, w_2] for the orthogonal [x_1, x_2, y] table input at penalty lam. On the default table the starter returns [9.5, 0.0] where the page computed [2.375, 0.0].
![Starter returns unnormalized [9.5, 0.0] instead of [2.375, 0.0] at lam = 2.5.](../assets/ml/one-coordinate-drops-out--exercise.png)
let lam = scene.parameter("lam", 2.5, 0.0, 13.0, 0.5);
let x1 = input.select(1, 0);
let x2 = input.select(1, 1);
let ys = input.select(1, 2);
let s1 = x1.square().sum();
let s2 = x2.square().sum();
let c1 = (x1 * ys).sum();
let c2 = (x2 * ys).sum();
let w1 = c1.sign() * (c1.abs() - lam).relu();
let w2 = c2.sign() * (c2.abs() - lam).relu();
let pair = torch.list().add(w1.reshape(1)).add(w2.reshape(1));
let answer = torch.cat(pair, 0);
out.set("weights", answer);
{
"weights": [
9.5,
0
]
}Compute [w_1, w_2] for the orthogonal [x_1, x_2, y] table input at penalty lam. On the default table the starter returns [9.5, 0.0] where the page computed [2.375, 0.0].
Read the result carefully
Compare the piecewise-linear Lasso path here against Ridge's curved path (the minimizer of ). Under Ridge, bends smoothly and stays positive (2 / 6.5 = 0.308 at lam = 2.5). Under Lasso, each orthogonal coordinate decreases at constant slope until it strikes zero at , creating a knot where the active set changes size.
Recap
- When , two-feature Lasso decouples into for .
- Any penalty in the window zeros out feature completely while keeping feature active.
- Geometrically, exact coordinate dropout occurs because error contours meet an axis corner of the L1 diamond .