For a hard-margin SVM trained on n linearly separable points, how do you prove that the leave-one-out error is at most NSV/n, where NSV is the number of support vectors, and what does this imply about the expected test error?

Supervised learning, Support vector machines
Level L5 Expert. Length Medium. Nature Th+Mat Both.

What's being asked

Whether you can use the optimality conditions to show that removing a non-support vector leaves the SVM unchanged, and connect leave-one-out error to test error.

Key idea

Leave-one-out (LOO) error trains n times, each time leaving one point out and testing on it. If point i has dual variable αi=0, the same (w,b) still satisfies the KKT conditions of the problem without point i, and since the problem is convex, it is still optimal. Point i has margin ≥1 under it, so it is classified correctly. Only leaving out a support vector can cause a LOO error.

Steps

  1. Recall the KKT conditions (the optimality conditions for constrained problems) for the dual solution α: w=∑jαjtjxj, ∑jαjtj=0, αj≥0, tj(w⊤xj+b)≥1, and complementary slackness αj[tj(w⊤xj+b)−1]=0. Here tj∈{−1,+1} are the labels, and support vectors are the points with αj>0.
  2. Take a non-support vector i (αi=0) and remove it. Keep the same (w,b) and the remaining αj. Stationarity still holds, because the removed term αitixi was zero. Feasibility and complementary slackness for the other points are unchanged.
  3. Conclude optimality. The SVM is a convex quadratic programme with linear constraints, so the KKT conditions are sufficient: (w,b) is optimal for the smaller problem. w is unique there, because 12∥w∥2 is strictly convex.
  4. Test the left-out point: ti(w⊤xi+b)≥1>0, so it is classified correctly. Hence every LOO error comes from a support vector, there are at most NSV of them, and dividing by n gives the bound.
  5. State the implication. The LOO error on n points is an almost unbiased estimate of the test error of a classifier trained on n−1 points (the Luntz–Brailovsky theorem). So E[test errorn−1]≤E[NSV]/n: few support vectors relative to n mean good generalisation, whatever the dimension.

Common mistakes

How long your answer should be

Half a page of proof; about 5 minutes.

Last checked on 4 December 2026.

Read this

Previous in Supervised learning: A random forest has features x1 (a truly informative binary variable) and x2 (a continuous pure-noise variable). Why can mean decrease in impurity (MDI) rate x2 as important, and how does permutation importance on the out-of-bag (OOB) data fix this? What is its own weakness with correlated features?
Next in Supervised learning: For two classes, how do you derive the asymptotic error of the 3-nearest-neighbour rule as a function of the posterior η(x), and how do you show that it is never worse than the 1-NN rule at every x? What are the errors of both rules when the local Bayes error is r=0.1?