Mild days 8 12 16 20 24 28 32 36 40 0 50 100 150 200 250 temperature, degrees z = (temperature − 24)²
One feature: temperature. On very cold days nobody buys ice cream, and on very hot days few go out. The ice cream sells out only on mild days: red circles in the middle, blue squares at both ends.
One threshold is not enough 8 12 16 20 24 28 32 36 40 0 50 100 150 200 250 temperature, degrees z = (temperature − 24)²
A linear classifier puts a threshold on a single feature: one side sells out, the other does not. Even the best single threshold on this data gets 3 days wrong.
A new axis 8 12 16 20 24 28 32 36 40 0 50 100 150 200 250 temperature, degrees z = (temperature − 24)² We add a second feature: z = (temperature − 24)². Each day rises onto the parabola. The days in the middle get a small z, those at the ends a large one.
Now one line is enough 8 12 16 20 24 28 32 36 40 0 50 100 150 200 250 temperature, degrees z = (temperature − 24)² In this two-dimensional space the horizontal line at z = 44.50 separates the classes: below sells out, above does not. The number of days on the wrong side is 0.
Back to temperature 8 12 16 20 24 28 32 36 40 0 50 100 150 200 250 temperature, degrees z = (temperature − 24)² The horizontal line matches two thresholds on the temperature axis: between 17.33 and 30.67 degrees it sells out. A straight boundary in the new space became an interval in the old one.
Where the trick is 8 12 16 20 24 28 32 36 40 0 50 100 150 200 250 temperature, degrees z = (temperature − 24)² In an SVM's computation, features only appear as the inner product of two examples. Instead of computing the new features one by one, a function that gives this inner product directly can be used: k(a, b) = ((a − m)(b − m))². That is the kernel function.
Infinite dimensions 8 12 16 20 24 28 32 36 40 0 50 100 150 200 250 temperature, degrees z = (temperature − 24)² The most used kernel is RBF: k(a, b) = e^(−γ(a − b)²). It matches an infinite-dimensional space, yet its computation is a single exponential. So an SVM can draw boundaries of any shape, circles and little islands included.
Why it matters 8 12 16 20 24 28 32 36 40 0 50 100 150 200 250 temperature, degrees z = (temperature − 24)² A linear model can solve a non-linear problem with the right features. A kernel adds those features unseen. Neural networks do the same job differently: hidden layers learn suitable features from the data themselves.