Class A Class B Decision plane
drag to orbit · scroll to zoom

The Kernel Trick (2D): Lifting Data Into a Separable Dimension

Concentric circles and XOR-style quadrants are the textbook examples of data that no straight line can separate in two dimensions — yet a single flat plane separates them perfectly once each point is lifted into a third, feature-space coordinate. This 2D-canvas companion renders that lift with a hand-rolled 3D→2D rotation (no WebGL): drag to orbit and watch a tangled 2D scatter rise into a paraboloid bowl or a tilted saddle as the explicit feature map z = γ(x₁²+x₂²) or z = γ·x₁·x₂ is applied, adjust the kernel coefficient γ to control how sharply the surface curves, move (or auto-fit) a decision plane to see the accuracy and misclassification counters update live, and click the mini top-down map to drop your own points into the classifier — the same geometric idea that lets a kernel SVM draw a curved boundary in the original space by finding a straight one in a higher-dimensional feature space it never has to build explicitly.