A hard-margin linear SVM is trained on (0,0) with label −1 and on (3,0), (0,3) and (4,4) with label +1. Find w, b, the margin and the dual variables αi. Which points are support vectors?

Supervised learning, Support vectors and KKT
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.

What's being asked

Whether you can find a maximum-margin separator in two dimensions by identifying the support vectors geometrically and checking the dual conditions.

Key idea

Support vectors satisfy ti(w⊤xi+b)=1; the dual variables satisfy w=∑iαitixi, ∑iαiti=0 and αi≥0, with αi=0 for points outside the margin.

Steps

  1. Plot the points. The only negative point is the origin, so the closest positive points matter. The positives (3,0) and (0,3) both lie on the line x1+x2=3, at distance 3/2 from the origin. The point (4,4) is further away.
  2. Guess that the origin and the two points on that line are the support vectors. By symmetry w=(a,a). The constraint at the origin, −(w⊤0+b)=1, gives b=−1.
  3. The constraint at (3,0), 3a−1=1, gives a=2/3. So w=(2/3,2/3), b=−1. The same holds at (0,3).
  4. Check the remaining point: w⊤(4,4)+b=23⋅4+23⋅4−1=163−1=133≈4.33≥1. It is outside the margin, so α4=0.
  5. The margin: ∥w∥=232=0.943, so the full margin width is 2/∥w∥=3/2≈2.12.
  6. Dual variables: w=α2(3,0)+α3(0,3)−α1(0,0) gives 3α2=3α3=2/3, so α2=α3=2/9. The condition ∑αiti=0 gives α1=α2+α3=4/9.
  7. All αi≥0, so the KKT conditions hold and the guess is confirmed. The support vectors are (0,0), (3,0) and (0,3); (4,4) could be removed without changing the solution.

Common mistakes

How long your answer should be

Half a page; 5 minutes.

Read this

Previous in Supervised learning: Gradient boosting for binary classification uses the log loss with F(x) as the log-odds. The data are x=1,2,3,4,5 with labels y=1,1,0,0,0. Start from the best constant, grow a stump that splits between x=2 and x=3, and use Newton leaf values with learning rate 0.5. What are the new probabilities?
Next in Supervised learning: In Poisson regression the count y has mean μ=ewx (one weight, no intercept). The data are (x,y)=(1,1) and (2,3). What are the log-likelihood, its gradient and Hessian, and the result of two Newton steps from w=0?