Chapter 6

Support vector machines

A linear SVM fixes a scale for the score and then maximises geometric separation. Keep functional margin, one-sided distance and full margin width separate. Kernel SVMs apply the same construction in a feature space.

6.1 Hyperplanes and hard margins

Past papers · DA 2024–2026 (3 papers): 3 questions, 5 marks

Let f(x)=w⊤x+bf(\mathbf x)=\mathbf w^\top\mathbf x+b, with w≠0\mathbf w\ne\mathbf0 and yi∈{−1,+1}y_i\in\{-1,+1\}. Classify by the sign of ff; boundary ties follow the specified convention. A dataset is strictly linearly separable if every yif(xi)>0y_if(\mathbf x_i)>0 for some w,b\mathbf w,b.

The hard-margin problem is feasible only for strictly separable data. At optimum, points on yifi=1y_if_i=1 are margin points. Points with positive dual coefficient are support vectors; in degenerate cases a margin point can have zero coefficient in a particular dual optimum. In ordinary geometry questions, identify all points on the supporting planes and note any degeneracy.

Two finite classes are strictly separable exactly when their convex hulls are disjoint. XOR-labelled opposite corners of a square fail this test. A drawing can suggest a separator, but check every point's signed score.

Canonical boundary and the two supporting planes; the blue segment is the full margin width.Canonical boundary and the two supporting planes; the blue segment is the full margin width.

6.2 Slack variables and hinge loss

Soft margins allow violations of the unit functional margin. Let Csvm>0C_{\rm svm}>0 be the penalty weight and ξi≥0\xi_i\ge0 be the slack of observation ii.

Minimum slackPoint position
00On or beyond the correct supporting plane
0<ξi<10<\xi_i<1Correct side of boundary, inside margin
ξi=1\xi_i=1On decision boundary
ξi>1\xi_i>1Wrong side of boundary

Larger CsvmC_{\rm svm} penalises violations more strongly relative to coefficient norm. It corresponds to weaker regularisation, whereas larger ridge λ\lambda gives stronger regularisation. Large CsvmC_{\rm svm} does not make nonseparable data separable.

6.3 Dual coefficients and kernels

Let K(x,v)=ϕ(x)⊤ϕ(v)K(\mathbf x,\mathbf v)=\boldsymbol\phi(\mathbf x)^\top\boldsymbol\phi(\mathbf v) be a kernel induced by a feature map ϕ\boldsymbol\phi. A valid real kernel has symmetric positive-semidefinite Gram matrices for all finite input sets.

The complementary-slackness conditions are αi(yifi−1+ξi)=0\alpha_i(y_if_i-1+\xi_i)=0 and (Csvm−αi)ξi=0(C_{\rm svm}-\alpha_i)\xi_i=0. Thus αi=0\alpha_i=0 implies yifi≥1y_if_i\ge1; 0<αi<Csvm0<\alpha_i<C_{\rm svm} implies yifi=1y_if_i=1; αi=Csvm\alpha_i=C_{\rm svm} permits yifi≤1y_if_i\le1. Equality can occur in degenerate cases. Only positive-coefficient examples contribute to prediction.

KernelExpressionSufficient parameter conditions
Linearx⊤v\mathbf x^\top\mathbf vReal vectors
Polynomial(x⊤v+c0)p(\mathbf x^\top\mathbf v+c_0)^pc0≥0c_0\ge0, integer p≥1p\ge1
Gaussian RBFexp⁡(−γ∥x−v∥2)\exp(-\gamma\|\mathbf x-\mathbf v\|^2)γ>0\gamma>0; also γ=1/(2s2)\gamma=1/(2s^2) for width s>0s>0

Kernel values use consistent scaled inputs; the RBF exponent is dimensionless. A symmetric similarity matrix alone does not establish positive semidefiniteness.

Last-minute recall

  • Check all signed scores when testing separability.
  • Canonical supporting planes have scores +1+1 and −1-1.
  • Full margin width is twice the one-sided margin.
  • A slack between zero and one is not a misclassification.
  • Positive dual coefficients identify contributing support vectors.
  • The bias equality needs a free support vector in the soft-margin case.
  • Kernelisation replaces inner products, not class labels or the intercept constraint.

Revise offline: the whole Machine Learning handbook as one PDF

42 pages · 1.8 MBFree to read online. Sign in to download the PDF.We save the handbook, version and request time in My downloads. Privacy policy

All chapters · Corrections