Home▸Machine Learning & Neural Networks▸The Kernel Trick (2D): Lifting Data Into a Separable Dimension

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

A 2D-canvas companion to the 3D kernel-trick sim: rotate a hand-rolled pseudo-3D projection of a non-linearly-separable dataset — concentric circles or an XOR grid — as an explicit feature map lifts it until a flat decision plane separates the classes. Click the mini top-down map to add your own points.

Machine Learning & Neural Networks2DAdvanced60 FPS📱 Mobile-adapted⇄ 3D version
2d-machine-learning-computer-science ↗ Open standalone

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.

⚙ Under the hood

A 2D-canvas companion to the 3D kernel-trick sim: a hand-rolled, draggable pseudo-3D projection shows concentric circles or an XOR grid lifted by an explicit feature map until a flat decision plane separates the classes, with a mini map to add your own points.

kernel-tricksvmfeature-spacemachine-learningclassificationrbf2d

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)