ML0052 Non-Linear SVM

Can you explain the concept of a non-linear Support Vector Machine (SVM)?

Answer

A non-linear SVM classifies data that is not linearly separable by using a kernel function to implicitly project the data into a higher-dimensional space where a linear separator exists. This kernel trick provides flexibility for complex datasets while staying computationally efficient: the algorithm never computes the high-dimensional coordinates, only inner products through the kernel. The kernel choice (RBF, polynomial, sigmoid) strongly influences performance and adaptability.

(1) Kernel Trick: Replace inner products with a kernel K(\mathbf{x}_i, \mathbf{x}_j), which measures similarity as if the data were mapped to a higher-dimensional space, where a linear separation becomes possible.
(2) Common Kernels: Polynomial (captures feature interactions of degree d), RBF/Gaussian (local similarity decaying with distance), sigmoid (imitates a neural activation).
(3) Objective: Find the margin-maximizing hyperplane in the transformed space; in the original space its image is a curved decision boundary.

Two panels on interleaving moons data showing the linear SVM's straight boundary cutting through a class and the RBF SVM's curved boundary separating them cleanly

Figure 1: Same data, two SVMs: the linear kernel can only slice the moons with a straight line (left), while the RBF kernel’s implicit high-dimensional map lets the boundary bend around both crescents (right).

Mathematical Formulation:
K(\mathbf{x}_i, \mathbf{x}_j) = (\gamma\, \mathbf{x}_i^\top \mathbf{x}_j + c)^d
K(\mathbf{x}_i, \mathbf{x}_j) = \exp\big(-\gamma \|\mathbf{x}_i - \mathbf{x}_j\|^2\big)
K(\mathbf{x}_i, \mathbf{x}_j) = \tanh(\gamma\, \mathbf{x}_i^\top \mathbf{x}_j + c)

Where (polynomial, RBF, sigmoid kernels in order):

  • \mathbf{x}_i, \mathbf{x}_j are input vectors; \gamma scales the inner product or controls the RBF width (\gamma = 1/(2\sigma^2), with \sigma the Gaussian spread).
  • c is a constant (bias) term and d the polynomial degree.
  • \|\mathbf{x}_i - \mathbf{x}_j\|^2 is the squared Euclidean distance: nearby points get RBF similarity near 1, distant points near 0.
Left panel one dimensional class data not separable by a point, right panel the same data lifted to two dimensions by x squared mapping and separated by a straight line

Figure 2: The kernel idea made concrete: in 1-D the blue class sits between the oranges and no single threshold separates them; after the explicit lift x \mapsto (x, x^2) the classes part vertically and one straight line suffices. Kernels compute as if this lift happened, without ever forming the new coordinates.


Login to view more content


Log in to track your progress

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *