What Is a Support Vector Machine (SVM)? A Plain-Language Explanation
A support vector machine (SVM) is a supervised learning algorithm that classifies data by finding a decision boundary, called a hyperplane, that separates the classes with the widest possible gap, known as the margin.
The simple analogy
Imagine two groups of dots on paper and a straight fence separating them. Many fences would work, but an SVM chooses the one that leaves the most room between the fence and the nearest dots on each side, so new points are less likely to fall on the wrong side.
What support vectors are
The closest points that define the position of the boundary are called support vectors. The margin is measured from these points, and moving them would change the boundary.
When a straight line is not enough
| Situation | Approach |
|---|---|
| Classes separated by a line | A linear hyperplane |
| Classes mixed in a curved pattern | A kernel maps data into a higher dimension where a boundary can separate them |
The kernel trick lets the model handle nonlinear patterns without explicitly computing every point in the higher dimension.
Where it is commonly used
SVMs are used for text classification, image recognition, handwriting detection, and problems with a limited number of features but relatively high dimensionality.
Honest caveats
Training an SVM can become slow on very large datasets, and choosing the kernel and its settings usually requires validation. The result is a clear boundary, but it is not a guarantee of accuracy on new data.
FAQ
What does the hyperplane do?
It acts as the decision boundary that separates one class from another.
What is the margin?
The gap between the hyperplane and the nearest data points of each class.
What is a kernel?
A function that lets the model handle nonlinear patterns by working in a higher-dimensional space.
Are SVMs used for classification or regression?
Mainly classification, though a variant called support vector regression also exists.
Key takeaways
- An SVM separates classes with a wide-margin hyperplane.
- Support vectors define the boundary.
- Kernels handle nonlinear patterns.
- It works well on high-dimensional, often smaller datasets.
Continue with what is k-nearest neighbors and what is a decision tree.
Sources
Learn by doing
Read a guide, then practice with bite-sized AI lessons you can take offline.
Start learning free