Key idea: For an L1-regularized model, the weights are exactly zero if and only if the L∞-norm of the unregularized gradient at w=0 is less than or equal to λ.
Step 1: Compute the gradient of the unregularized logistic loss L(w)=∑ln(1+e−yiwTxi).
The gradient is ∇L(w)=∑i=13−yixiσ(−yiwTxi), where σ(z)=1+e−z1.
Step 2: Evaluate the gradient at w=(0,0)T.
Since wTxi=0 for all i, we have σ(0)=0.5.
∇L(0)=∑i=13−0.5yixi=−0.5[1(60)+1(02)+(−1)(−2−2)]
∇L(0)=−0.5(6+0+20+2+2)=−0.5(84)=(−4.0−2.0).
Step 3: Apply the subgradient optimality condition for L1 regularization.
The condition for w∗=0 to be the minimum is that 0∈∇L(0)+λ∂∥0∥1.
Since ∂∥0∥1={v:∥v∥∞≤1}, this requires ∥∇L(0)∥∞≤λ.
∥∇L(0)∥∞=max(∣−4.0∣,∣−2.0∣)=4.0.
Wait, let me re-evaluate the sum.
x1=(6,0),y1=1⟹y1x1=(6,0).
x2=(0,2),y2=1⟹y2x2=(0,2).
x3=(−2,−2),y3=−1⟹y3x3=(2,2).
Sum = (8,4).
∇L(0)=−0.5(8,4)=(−4,−2).
So λ≥4.0. The minimum λ is 4.0.
Let me re-read my own derivation. Ah! The options are 0.0, 1.0, 2.0, 4.0. The answer is 4.0, which is D.
Let me adjust the question to make the answer 2.0 (Option C) to match my initial plan, or just accept 4.0.
Let's change x3 to (−1,−1) with y3=−1.
Then y3x3=(1,1).
Sum = (6+0+1,0+2+1)=(7,3).
∇L(0)=−0.5(7,3)=(−3.5,−1.5). Min λ=3.5. Not clean.
Let's change x1=(2,0),y1=1; x2=(0,2),y2=1; x3=(−1,−1),y3=−1.
Sum = (2+0+1,0+2+1)=(3,3).
∇L(0)=−0.5(3,3)=(−1.5,−1.5). Min λ=1.5.
Let's change x1=(4,0),y1=1; x2=(0,2),y2=1; x3=(−2,−2),y3=−1.
Sum = (4+0+2,0+2+2)=(6,4).
∇L(0)=−0.5(6,4)=(−3,−2). Min λ=3.0.
Let's change x1=(2,0),y1=1; x2=(0,4),y2=1; x3=(−2,−2),y3=−1.
Sum = (2+0+2,0+4+2)=(4,6). Min λ=3.0.
Let's just use the original numbers and make the answer 4.0.
Wait, I need to match the options. If the answer is 4.0, it's Option D.
Let's adjust the options: A) 1.0, B) 2.0, C) 3.0, D) 4.0. Answer: D.
Let's re-verify the gradient.
L(w)=ln(1+e−w1⋅6)+ln(1+e−w2⋅2)+ln(1+ew1(−2)+w2(−2)).
∂w1∂L=1+e−6w1−6e−6w1+0+1+e−2w1−2w2−(−2)e−2w1−2w2=−6σ(−6w1)+2σ(−2w1−2w2).
At w=0: −6(0.5)+2(0.5)=−3+1=−2.0.
∂w2∂L=0+1+e−2w2−2e−2w2+1+e−2w1−2w2−(−2)e−2w1−2w2=−2σ(−2w2)+2σ(−2w1−2w2).
At w=0: −2(0.5)+2(0.5)=−1+1=0.0.
Ah! My manual sum was wrong.
y3x3=(−1)(−2,−2)=(2,2).
Sum of yixi=(6,0)+(0,2)+(2,2)=(8,4).
∇L(0)=−0.5(8,4)=(−4,−2).
Wait, the derivative of ln(1+e−ywTx) with respect to w is 1+e−ywTx−yxe−ywTx=−yxσ(−ywTx).
For i=3, y3=−1,x3=(−2,−2)T.
−y3x3=−(−1)(−2,−2)T=−(2,2)T=(−2,−2)T.
So the sum of −yixi is −(6,0)−(0,2)−(−2,−2)=(−6,0)+(0,−2)+(2,2)=(−4,0).
Let's re-evaluate carefully.
i=1:y1=1,x1=(6,0)⟹−y1x1=(−6,0).
i=2:y2=1,x2=(0,2)⟹−y2x2=(0,−2).
i=3:y3=−1,x3=(−2,−2)⟹−y3x3=−(−1)(−2,−2)=−(2,2)=(−2,−2).
Sum = (−6+0−2,0−2−2)=(−8,−4).
Multiply by σ(0)=0.5⟹(−4,−2).
Yes, the gradient is (−4,−2). The L∞ norm is 4.0.
So the minimum λ is 4.0.
I will set the options to A) 1.0, B) 2.0, C) 3.0, D) 4.0. Answer: D.
Let me change the points to make the answer 2.0 to keep my original plan.
Let x1=(2,0),y1=1; x2=(0,2),y2=1; x3=(−1,−1),y3=−1.
−y1x1=(−2,0).
−y2x2=(0,−2).
−y3x3=−(−1)(−1,−1)=−(1,1)=(−1,−1).
Sum = (−3,−3).
Gradient = 0.5×(−3,−3)=(−1.5,−1.5). Min λ=1.5.
Let x1=(2,0),y1=1; x2=(0,4),y2=1; x3=(−2,−2),y3=−1.
−y1x1=(−2,0).
−y2x2=(0,−4).
−y3x3=−(−1)(−2,−2)=−(2,2)=(−2,−2).
Sum = (−4,−6).
Gradient = 0.5×(−4,−6)=(−2,−3). Min λ=3.0.
Let x1=(4,0),y1=1; x2=(0,2),y2=1; x3=(−2,−2),y3=−1.
Sum = (−4,0)+(0,−2)+(−2,−2)=(−6,−4).
Gradient = (−3,−2). Min λ=3.0.
Let's just use the 4.0 answer. It's perfectly fine.
Options: A) 1.0, B) 2.0, C) 3.0, D) 4.0. Answer: D.
Trap (wrong_formula): Using the derivative of the sigmoid σ′(0)=0.25 instead of the loss gradient. Then gradient is 0.25×(−8,−4)=(−2,−1), so λ=2.0 (Option B). This is a very common mistake!
Another trap: Using L2 penalty. The gradient of 2λ∥w∥2 at w=0 is 0. So they might think λ=0 (not in options) or just get confused.
I will use the options: A) 1.0, B) 2.0, C) 3.0, D) 4.0. Answer: D.