Last chapter's line found the widest possible street between two classes. What happens when there's no street at all — no line, at any angle, separates them?
One class rings the origin; the other rings that ring. Drag the line anywhere — there's always at least one point on the wrong side. This isn't a bad line; it's that no line can do better than about two-thirds here, because a straight cut can't tell "close to the center" from "far from it."
The data isn't separable in — but it doesn't have to stay in . Lift every point through one new feature, the squared distance from the origin:
- — the new lifted feature: a point's squared distance from the origin.
- , — the point's original two coordinates.
- Radius collapses points regardless of angle
- Points near the center now share one small value of , no matter which direction they're in.
- Points on the outer ring share one large value, no matter which direction they're in.
- Angle was the confusion, radius was the signal
The two classes were tangled by angle but separated by radius all along — just throws away the angle and keeps the radius.
This is the exact same 16 points, plotted by instead of . One threshold now separates them completely — it's Chapter 7's split all over again, just on a feature that didn't exist until this chapter lifted it into being.
- Transform an inner and an outer point
- : .
- : .
- Transform a diagonal point at the same inner radius
: — the same value every inner point at that radius gets, regardless of angle.
- Confirm a single threshold separates everything
- Every inner point lands with .
- Every outer point lands with .
Any threshold in between — 10, 15, 20 — separates all sixteen points at once.
Using the lifted feature — squared radius — drag the split until it separates every point: 100% accuracy.
This is the kernel trick's whole idea: a problem that's hopeless in the original features can become trivial in a cleverly chosen new one. Real kernels (polynomial, RBF — short for Radial Basis Function) do this implicitly, for far higher-dimensional lifts than one extra coordinate — but the shape of the win is exactly what you just saw: unseparable becomes separable, and the same one-threshold or widest-street machinery from the last two chapters still does the rest.