How it works...

SVMs are a set of supervised learning methods that can be used for both classification and regression. Given two classes of linearly separable multidimensional patterns, among all the possible separating hyperplanes, the SVM algorithm determines the one able to separate the classes with the greatest possible margin. The margin is the minimum distance of the points in the two classes in the training set from the hyperplane identified. 

Maximization of the margin is linked to generalization. If the training set patterns are classified with a large margin, you can hope that even test-set patterns close to the boundary between the classes are managed correctly. In the following, you can see three lines (l1, l2, and l3). Line l1 does not separate the two classes, line l2 separates them, but with a small margin, while line l3 maximizes the distance between the two classes:

SVMs can be used to separate classes that cannot be separated with a linear classifier. Object coordinates are mapped into a space called a feature space using non-linear functions, called characteristic functions. This space is highly multidimensional, in which the two classes can be separated with a linear classifier. So, the initial space is remapped in the new space, at which point the classifier is identified and then returned to the initial space.