What is an SVM and when is it still worth using?
A support vector machine (SVM) is a machine learning method that separates categories by seeking a wide margin between them in the examples used for training.
A support vector machine (SVM) is a machine learning method that distinguishes categories using examples whose categories are already known. For instance, it can classify a manufactured part as acceptable or defective from production measurements. It seeks a boundary with a wide margin, a separation band as broad as possible, while balancing that goal against errors and margin violations in the training data. The examples contributing to the decision are called support vectors. The method can use a kernel, a function that compares examples and also allows curved boundaries. Cortes and Vapnik's paper extends the method to data that cannot be separated without error. An SVM is worth considering even when there are more variables than examples, but its performance must be tested on data held out from training: a wide margin alone does not guarantee correct predictions.
See also: PerceptronThe perceptron is the simplest artificial neuron: it weighs its inputs, compares the total to a threshold, answers yes or no and corrects its weights on errors.
The widest margin and the kernel trick
Like a perceptron, a linear SVM uses a straight boundary. The soft-margin version also allows examples inside the margin or on the wrong side of the boundary: the C parameter controls the tradeoff between margin width and the penalty for these violations. A kernel allows more complex boundaries. With the RBF kernel, which measures similarity based on distance, the gamma parameter controls how far a single example's influence reaches. The scikit-learn explanation of RBF parameters shows how unsuitable values can cause overfitting, meaning too close a fit to examples already seen.
When to choose it today, and when not to
An SVM should be compared with decision trees on the same problem, without assuming a winner. The SVC documentation warns that training time grows at least quadratically with the number of examples and can become impractical beyond a few tens of thousands. For larger datasets, it suggests linear methods, possibly after a kernel approximation: the limit applies to kernel SVMs, not linear ones.
A decision score is not a probability. If the decision requires usable probabilities, check their calibration: whether assigned probabilities match observed frequencies. The SVM guide notes that calibration is costly and can produce probabilities inconsistent with the predicted class.
An enterprise example
A machining company has many sensor readings from acceptable parts and very few documented defects. It could consider a one-class SVM, a variant that learns the boundary of normal cases and flags unusual measurements for an inspector. With a very large dataset, this kernel variant also runs into the same scaling limit. The anomaly detection guide warns that the method is sensitive to outliers in its training data. The company therefore needs vetted historical data, independent examples to evaluate alerts, and human inspection of parts.
Why it matters for decision makers
Before choosing, ask how large the dataset will grow, what a missed defect costs, and how many alerts staff can handle. The validation guide recommends holding out data for a final test and fitting data transformations on the training set only. Judge whether the process is fit for purpose on prediction quality, processing time, and review costs, not on the algorithm's name.
Frequently asked questions
Related terms
- PerceptronThe perceptron is the simplest artificial neuron: it weighs its inputs, compares the total to a threshold, answers yes or no and corrects its weights on errors.
- Decision treesA decision tree is a model that learns a sequence of rules from data to assign a category or predict a numerical value for a case it has not seen before.
- OverfittingWhen a model learns the noise in its training data instead of the rule, and collapses on new data it has never seen.
- Confidence CalibrationHow well an AI model's stated confidence actually matches its real probability of being right.
- EmbeddingsAn embedding is a numerical representation of content, which lets a system compare it with other content based on the similarity an AI model has learned.