An SVM chooses a decision boundary by balancing its norm against small signed margins.
Summary
Let negative examples be and positive examples be . Which linear score separates them with the widest normalized margin? Use labels and predict the sign of the score, with an explicit tie policy at zero. The figure illustrates a soft-margin fit; its three highlighted points are not this four-point dataset.
Learning objective
Only nonzero dual weights contribute to the SVM decision sum
Derivation
Does a zero dual contribution delete the corresponding training observation?
The hard-margin SVM (separable case)
Normalize the nearest signed scores to at least one:
The examples at and require and . Adding gives . Thus achieves the minimum objective . Signed margins are ; the rails are at and , with width . Without score normalization, multiplying both parameters changes no boundary and makes raw score gaps meaningless.
The soft-margin SVM (non-separable)
Change the requirement: price violations instead of forbidding them. For , minimize
The separating fit costs ; the constant-zero score costs . At , zero beats that separator: . Neither comparison proves that zero is optimal. The optimum is , with objective . Coefficients satisfy the dual constraints and achieve the same objective. All four points now support the fit; retaining the hard-margin coefficients would violate their new upper bound. Slack is , not necessarily a misclassification. A correctly classified score still pays .
The dual formulation and the kernel trick
The soft-margin dual is
For hard margin, remove the upper bound on . In the four-point example, coefficients reconstruct . Their dual objective is , matching the primal and certifying optimality.
Change the requirement: use an RBF kernel on only , with labels and . Set and . The cross-similarity is ; diagonal entries are one. The equality constraint makes both coefficients . Their dual is , maximized at within . With , both signed scores equal . Doubling makes cross-similarity and changes the optimum to . Do not reuse the old coefficients after changing kernel geometry. Use symmetric positive-semidefinite kernels; an arbitrary similarity need not yield a convex dual.
Support vectors
Prediction uses . Zero coefficients remove terms from this fitted score, not a guarantee about arbitrary retraining or preprocessing changes. For a soft-margin optimum, implies a point lies on its rail. Points with can lie on or inside it.
Reconstruct: does a large positive score mean a calibrated probability? No: margin optimization supplies no probability normalization or calibration guarantee.
When to use SVMs in 2026
Compare a scaled linear SVM, an RBF SVM and task-appropriate alternatives under the same validation protocol. A dense Gram matrix stores entries; solver cost depends on the implementation and data. Linear solvers need not materialize that matrix. Kernel prediction evaluates one term per retained support vector, so measure deployment cost too.
Common pitfalls
Scale features using training-only statistics and tune interacting parameters inside validation folds. For , changing units changes similarities unless changes appropriately. Hinge loss is not log loss, and sigmoid similarities are not PSD for arbitrary parameters. The primal is strictly convex in , not jointly strictly convex in the unregularized intercept. For example, opposite labels at the same zero input admit every when .
Related
- Kernel methods owns feature-inner-product equivalence.
- Calibration separates scores from estimated probabilities.
- Linear regression provides a squared-error contrast.