Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 65 5 Solution Created 2026-10-03 Updated 2026-10-06
A kernel support vector machine constructs a large-margin classifier in a feature Hilbert space. Given training points and labels , choose a feature map and an affine score . Prediction is the sign of the score. Normalizing the functional margin to one makes the closest separating geometric margin , and the full margin between the two supporting hyperplanes is . Maximizing that margin therefore minimizes .
For separable data, the hard-margin support vector machine primal isNoisy or nonseparable data use slack variables and the soft-margin support vector machine:Eliminating gives the equivalent hinge loss objective . The parameter balances margin size against violations; it is not a hard bound on their number. The bias is unpenalized here, which determines the equality constraint in the dual.
Attach multipliers to and to . The Lagrangian isStationarity gives , and . Eliminating yieldswhere is a positive-definite kernel, meaning positive semidefinite Gram matrices. The hard-margin dual is the same objective with only , without the upper bound. Soft-margin strict feasibility follows by taking and all , so strong duality and the Karush-Kuhn-Tucker conditions apply. For separable hard-margin data a separator can be rescaled to give strict margins, supplying the analogous qualification. Although the feature space may be infinite dimensional, projecting onto the finite span of the training feature vectors preserves scores and cannot increase its norm, so this optimization reduces to a finite span.
The complementary slackness relations arePoints with are support vectors. If , then and ; such a point gives . A point with can lie inside the margin or be misclassified, while contributes no term to . If no coefficient lies strictly between the bounds, an admissible bias must be obtained from the KKT inequalities, rather than dividing by a nonexistent margin vector. Bias and dual coefficients can be nonunique even when the optimal feature-space weight is unique.
The kernel trick operates both during training and prediction. The dual optimization uses only the Gram matrix , so the feature vectors need not be formed. Prediction likewise usesA nonlinear kernel therefore makes a linear separator in feature space represent a nonlinear boundary in input space. For example, on the degree-two polynomial kernel corresponds to . Gaussian kernels yield infinite-dimensional feature spaces. An arbitrary similarity is not automatically a valid kernel: for every finite collection and real coefficients , one needs . This makes the dual quadratic form positive semidefinite and the maximization concave.
Mercer's theorem gives a spectral realization under its additional analytic hypotheses. For a continuous symmetric positive-semidefinite kernel on a compact domain with a finite full-support measure, the integral operator is compact, self-adjoint and positive. The Mercer expansion iswith the standard uniform convergence conclusions under these hypotheses. Since , the nonlinear feature mapis well defined. This explains the connection of Mercer kernels to Hilbert space features, rather than treating the kernel trick as a purely formal substitution.
The finite-Gram positivity condition is more general than this compact-domain spectral theorem. Every such kernel generates a Reproducing-kernel Hilbert space: on finite sums of kernel sections definequotient out zero-norm elements, and complete. The resulting space satisfies the reproducing property . Its canonical feature map is , whose inner product is exactly . A feature map need not be injective; calling it an embedding does not by itself prove distinct inputs remain distinct. The kernel support vector machine uses this geometry together with convex duality to fit and evaluate a maximum-margin classifier while accessing the geometry only through kernel evaluations.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 325 3 iii Solution Created 2026-10-03 Updated 2026-10-06
Write the objective as with . Each hinge loss is finite and convex, so the subdifferential sum rule applies without a qualification gap. Its subdifferential isThis formula also covers , if such a sample is allowed, because the loss is then constant. For a convex function, zero in the subdifferential is necessary and sufficient for global optimality. Thus is optimal exactly when there are weights such thatEquivalently, using and ,The notation denotes the segment between and , also when . This avoids reversing interval endpoints for negative-class samples.
Because , the objective is strongly convex, and makes it coercive. It is continuous, so a minimizer exists and is unique for every finite data vector . The weights at exact margins need not be unique even though is. These are the hinge-loss optimality weights for the one-dimensional support vector machine.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 205 5 Solution Created 2026-10-03 Updated 2026-10-05
For and labels , with squared-norm penalty normalized as , the kernel soft-margin support vector machine solvesHere is the hinge loss building block, and is column of the symmetric kernel matrix. The prediction iswith a fixed class choice, for example , when the score is zero. Other positive rescalings of the penalty change numerical coefficients in the optimality equation but not the zero-coefficient conclusion.
For a finite convex function , its subdifferential at isFor , affine composition preserves the defining convexity inequality: for ,If , the subgradient inequality gives , proving .
Conversely, let and first suppose . For every , the function is constant along . Applying the subgradient inequality for both signs of shows . Thus is in the span of , or with . Substituting gives for every real . Hence . If , is constant and ; since finite convex on all of has a nonempty subdifferential at , as well. This handles the case in which the suggested orthogonal projection would be undefined. ThereforeThis proves the subdifferential under scalar affine composition identity with all its degenerate cases.
Let be a fitted support-vector-machine margin. The subdifferential of the hinge loss yields choicesApplying the affine-composition identity and the subdifferential sum rule to the convex objective, its optimum satisfiesThe second equation is the intercept condition. Since is invertible, multiplying the first by gives the kernel support-vector coefficient from hinge activity formulaIn particular Invertibility is needed for this statement about the chosen coefficients: for with two positive labels, and give zero objective and both margins equal to two, while both coefficients are nonzero. A singular kernel matrix allows coefficient changes in the null space without changing the fitted function.
At prediction time, the sum can omit all zero coefficients, requiring only the number of evaluations of the positive-definite kernel corresponding to retained support vectors rather than all . This need not remove the cost of forming or solving with a dense training kernel matrix. Every misclassified point has , including a score-zero tie assigned to the opposite class, so and . Thus many classification errors imply many active support vectors and little prediction-time sparsity benefit. Correctly classified points inside the unit margin can also have nonzero coefficients; a point exactly on the margin need not have a nonzero coefficient.
Past exam of the mathematics course of the University of Cambridge 2018 iii Paper 218 2 b Solution Created 2026-10-03 Updated 2026-10-05
Fix and use the unnormalized sum convention for the penalty. The linear soft-margin support vector machine solvesEliminating the slack variables of a support vector machine gives , where and the maximum is the hinge loss. The classifier uses the sign of and its support-vector-machine decision boundary is .
For clarity about dual support vectors and margin degeneracy, let be the multipliers of the margin constraints. The Karush-Kuhn-Tucker conditions giveThe dual support vectors are those with . A coefficient strictly between and puts a point exactly on its margin boundary; a point with positive slack has . A zero coefficient implies zero slack and signed margin at least one. Geometrically one often counts all points with as support vectors. At a degeneracy, equality can occur with , so the two descriptions need not coincide. Either convention supports the bound in the following part when stated consistently.
Past exam of the mathematics course of the University of Cambridge 2024 iii Paper 218 4 a Solution Created 2026-09-24 Updated 2026-09-25
For and , a linear support vector machine predictsOne penalized formulation minimizes empirical hinge loss plus a squared Euclidean norm penalty:Conventions often leave the intercept unpenalized, replacing by ; this does not change the role of the two terms.
Past exam of the mathematics course of the University of Cambridge 2025 ii Paper 1 31L d Solution Created 2026-09-24 Updated 2026-10-03
The hinge loss is one-Lipschitz. Centering it at zero and applying the contraction lemma givesFor an empirical risk minimizer and a population minimizer, the standard expected ERM inequality with the Rademacher convention used in part (a) isPart (c) consequently yieldsThus for this normalization of Rademacher complexity.