Search⌘ K
AI Features

Support Vector Machine

Explore how Support Vector Machines work to classify both linearly and non-linearly separable data sets. Understand the concepts of hyperplanes, margins, and support vectors, and learn how kernel functions transform data for effective classification. Apply linear SVM and kernel SVM using Scikit-Learn to build and evaluate models.

What is Support Vector Machine?

Support Vector Machine (SVM) is widely used for classification (SVM also supports regression tasks). In general, SVM finds a hyperplane that separates data points with the greatest amount of margin.

The core idea of SVM is to find a maximum marginal hyperplane that divides the dataset. For a data set with two classes, if they’re linearly separable, then you can find an infinite number of hyperplanes to separate them. The SVM finds only one of these hyperplanes, which is the maximum marginal hyperplane.

As you can see in the image above, the black and white circles can be separated by multiple lines. Both lines H2 and H3 can separate this data set. However, the point closest to the two lines is different, which means the margins of the two lines are different. According to the definition of SVM, what we need is the line with the largest margin. We need H3.

What is support vector? They are data points that are closest to the hyperplane. In a more intuitive sense, they define the lines of margins. That’s the dotted line in ...