A linear support vector regression (SVR) with an ε-insensitive loss, ε=0.5 and C=2, is trained on five points (x,y) and learns f(x)=x (so w=1, b=0). The points are A=(0,0.1), B=(1,1.5), C=(2,1.5), D=(3,1.8) and E=(4,5.0). Using the dual variables, which points are support vectors, and which have zero training loss?

Supervised learning, Support vector machines
Level L3 Intermediate. Length Medium. Nature Th+Mat Both.

What's being asked

Whether you can connect the picture of the ε-tube around f to the optimality conditions of SVR.

Key idea

The loss is max⁡(0,∣y−f(x)∣−ε): errors smaller than ε are free. Each point has two dual variables αi,αi∗∈[0,C], one for each edge of the tube, and the model is w=∑i(αi−αi∗)xi. A point is a support vector when one of them is nonzero. Inside the tube both are 0 (not a support vector, zero loss); on the edge one can be between 0 and C (support vector, zero loss); outside, one equals C (support vector, positive loss).

Steps

  1. Write the primal problem: min⁡12∥w∥2+C∑i(ξi+ξi∗) subject to yi−f(xi)≤ε+ξi, f(xi)−yi≤ε+ξi∗ and ξi,ξi∗≥0. The slacks ξi,ξi∗ measure how far a point lies above or below the tube.
  2. State the KKT conditions (the optimality conditions for constrained problems) that matter here. Complementary slackness: αi(ε+ξi−yi+f(xi))=0, so αi can be nonzero only if the constraint is tight. And (C−αi)ξi=0, so a positive slack forces αi=C. The same holds for the starred pair, and at most one of αi,αi∗ is nonzero.
  3. Compute the residuals r=y−f(x): A: 0.1, B: 0.5, C: −0.5, D: −1.2, E: 1.0.
  4. Inside and on the edge: A has ∣r∣<ε, so neither constraint is tight, αA=αA∗=0, it is not a support vector and has loss 0. B and C have ∣r∣=ε (on the upper and lower edges of the tube), so their constraints are tight; they are support vectors with 0≤α≤C and loss 0.
  5. D and E: outside the tube (D below it, E above it), so their slack is positive, which forces αD∗=C=2 and αE=C=2. They are support vectors, with losses 1.2−0.5=0.7 and 1.0−0.5=0.5.
  6. Check with the dual. Stationarity gives ∑i(αi−αi∗)=0 and w=∑i(αi−αi∗)xi. Put αB=t, αC∗=s, αD∗=αE=2 and all others 0. The first condition gives t−s−2+2=0, so s=t; the second gives t−2s−6+8=1, so t=1. Both edge values lie between 0 and C, so every KKT condition holds and f(x)=x really is the SVR solution.
  7. Summarise: support vectors B,C,D,E; zero loss A,B,C. Removing A would not change f, because A does not appear in w=∑i(αi−αi∗)xi.

Common mistakes

How long your answer should be

One short paragraph of KKT reasoning plus a five-row table; 3–4 minutes.

Read this

Previous in Supervised learning: How can you show that k(x,z)=(1+x⊤z)2 on R2 is a valid kernel by finding a feature map ϕ with k(x,z)=ϕ(x)⊤ϕ(z)? What is Mercer's condition, and why does it show that k(x,z)=x⊤z−1 is not a valid kernel?
Next in Supervised learning: Two regression models f1 and f2 are combined as y^=wf1(x)+(1−w)f2(x). Assume both are unbiased, their errors e1=f1(x)−y and e2=f2(x)−y have variances σ12 and σ22, and Cov⁡(e1,e2)=ρσ1σ2, where ρ is the correlation of the errors. Which w minimises the variance of the combined error, and what is that minimum variance?