Home Knowledge Base Support Vector Machine (SVM)

Support Vector Machine (SVM) is a supervised machine learning algorithm that finds the optimal hyperplane separating classes with the maximum margin — where the "support vectors" are the data points closest to the decision boundary that define the margin, and the "kernel trick" enables SVMs to handle non-linearly separable data by projecting it into higher-dimensional spaces where a linear separator exists, providing strong theoretical guarantees and excellent performance on small-to-medium datasets with high-dimensional features.

What Is an SVM?

Key Concepts

ConceptExplanationVisual Intuition
HyperplaneThe decision boundary (line in 2D, plane in 3D, hyperplane in higher-D)The wall between two groups
MarginDistance between the hyperplane and the nearest data pointsThe gap between the wall and the closest people
Support VectorsData points closest to the hyperplaneThe people standing right at the edge of the gap
Hard MarginNo data points allowed inside the marginOnly works for perfectly separable data
Soft Margin (C)Allows some misclassification (controlled by parameter C)Tolerates some overlap for robustness

The Kernel Trick

When data isn't linearly separable (you can't draw a straight line between classes), kernels project the data into a higher dimension where linear separation is possible:

KernelWhen to UseExample
LinearData is linearly separableText classification (high-D, sparse)
RBF (Radial Basis Function)General-purpose non-linearMost common default
PolynomialPolynomial decision boundariesImage features
SigmoidSimilar to neural networksRarely used in practice

RBF Kernel Intuition: Imagine concentric circles of Class A surrounded by Class B — linear separation is impossible in 2D. The RBF kernel maps points to a 3D space (adding a "height" feature based on distance from center) where a flat plane separates the lifted Class A from Class B.

SVM vs. Modern Alternatives

FeatureSVMRandom ForestXGBoostNeural Network
Small datasets (<10K)ExcellentGoodGoodPoor (overfits)
Large datasets (>100K)Slow (O(N²-N³))GoodExcellentExcellent
High-dimensional (text, genomics)ExcellentGoodGoodExcellent
InterpretabilityModerate (support vectors)Good (feature importance)GoodPoor (black box)
Training timeSlow for large NFastFastVariable

When to Use SVM

Support Vector Machines are the mathematically elegant algorithm for classification with maximum-margin separation — providing strong generalization guarantees through the margin-maximizing objective, efficient handling of high-dimensional data through the kernel trick, and memory-efficient models that depend only on support vectors, making them the algorithm of choice for small datasets with high-dimensional features.

svmsupport vectorkernel

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.