Lifting the data
The topic Support vector machines ended with two facts. Its dual problem and its classifier touch the training points only through inner products . And whatever we pick, the boundary is a hyperplane in the original features. As there, the classes are .
A hyperplane is not always enough. Take XOR, four points in the plane:
- and belong to class ;
- and belong to class .
No line separates them, and a linear SVM gets two of the four right.
The fix is to give the linear model better features. A feature map sends each object to a vector in a richer space, and the model stays linear there: . For XOR one extra coordinate is enough:
The third coordinate separates the classes on its own, so and do the job. A plane in the lifted space becomes a curve in the original one: here the boundary is the pair of coordinate axes.
In general we do not know which product to add, so we add them all. All products of features up to degree are the monomials of degree at most , and in variables there are
of them. For and that is features per object, each with its own weight. Writing them down quickly becomes the bottleneck. This topic shows how to use them without ever writing them down.