A straight line cannot separate every dataset. The kernel method reshapes the problem by adding columns or embedding points in a higher-dimensional space, where a linear boundary may separate them; projecting that boundary back produces a nonlinear classifier. section 11.3
Follow the method as a geometric transformation:
- Start with points that a line cannot separate. section 11.3
- Add informative columns, such as x1x2, x1², x1x2, and x2², or use similarity columns generated by a kernel. section 11.3
- Train a linear classifier, typically an SVM, in the expanded space. section 11.0 section 11.4
- Project the boundary back to the original space, where it can appear as a circle, curve, or more complex region. section 11.4
Turning a circle into a linearly separable problem
Suppose triangles and squares form concentric groups. Add the feature x1² + x2², which records each point’s squared distance from the origin. In three dimensions, a plane can separate the groups; projected back onto the original plane, that separation becomes the circular boundary x1² + x2² = 1.
Using an RBF kernel
An RBF kernel creates a similarity feature for each reference point: nearby points receive high similarity and distant points receive low similarity. Combining these features lets an SVM form curved boundaries. Gamma controls the width of each similarity surface: smaller values make it wider, while larger values make it narrower.
