# Support vector machine (SVM)

> Canonical: https://skillalmanac.com/glossary/support-vector-machine | Last verified: 2026-11-25 | Index status: index-eligible

A support vector machine (SVM) is a supervised learning method used for classification, regression and outlier detection. In margin classification, support vectors determine the decision boundary; soft-margin models allow violations rather than requiring perfectly separable classes.

Also called: SVM, SVMs, support vector machines, SVM machine learning.

## In plain language

Picture red and blue dots on a table and a ruler laid between them. In the separable classification illustration, an SVM chooses the ruler position with the widest empty strip between the two colours, so a new dot is more likely to land on the right side. Support vectors determine the boundary; in soft-margin classification they can also lie inside the margin or be misclassified. When the dots cannot be split by a straight line, a trick called a kernel lets it find a curved boundary. The cost: you should scale your numbers first, it can be slow on large datasets, and it gives scores rather than ready-made probabilities.

## Technical definition

An SVM decision function depends on support vectors selected from the training data, per scikit-learn; in some datasets every training point is a support vector. IBM describes the hyperplane as the decision boundary and the margin as the space the algorithm maximizes between classes. In general terms, the kernel trick replaces dot products with a kernel function, such as linear, polynomial or rbf in scikit-learn, so a non-linear boundary can be found. scikit-learn notes SVMs are not scale invariant and do not directly provide probability estimates.

## How it shows up when you use agents

An SVM is a classic modelling method, so you will not meet it while prompting Claude Code, Codex or Cursor about ordinary code. It appears when you ask an agent to build a classifier on a table with scikit-learn, as one option beside [logistic regression](/glossary/logistic-regression) and tree models.

What breaks when it is misunderstood. scikit-learn says SVMs are not scale invariant and highly recommends scaling the data, so skipping that step can give poor results. It also notes the same scaling must be applied to test data. Another trap is reading `predict_proba` as native output: scikit-learn says SVMs do not directly provide probability estimates and calculates them with an expensive cross-validation. IBM adds that SVMs need hyperparameter tuning and can be more computationally expensive.

Next actions. Put a scaler and the SVM in one pipeline, check the split with [split-leakage-check](/skills/skill-almanac/split-leakage-check), and tune on validation data. Margin classification is one SVM use; the family also includes regression and outlier detection.

## Common confusions

- **SVM versus logistic regression.** Both can separate classes with a linear boundary. Logistic regression outputs probabilities directly; an SVM focuses on the margin and outputs scores.
- **SVM versus neural network.** An SVM with a kernel is not a neural network. It is a separate family of method.
- **Support vectors versus all training points.** The decision function depends on the support vectors, which can include all training points. Soft-margin support vectors need not all sit exactly on the margin.
- **Myth.** The kernel trick removes overfitting risk. IBM notes that higher-dimensional spaces can raise it, so see [Overfitting](/glossary/overfitting).

## Worked examples in this catalogue

### [split-leakage-check](https://skillalmanac.com/skills/skill-almanac/split-leakage-check)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A check of train, validation and test files for duplicates, shared groups, time and label leakage, printed as JSON.

Why it exercises the concept: An SVM is tuned against a validation set, so leakage between files misleads the tuning. The catalogue has no training skills; this is the nearest check that applies to any classifier.

### [data-analysis-eda](https://skillalmanac.com/skills/skill-almanac/data-analysis-eda)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A fixed exploratory-analysis procedure and CSV profiler that keeps findings descriptive, evidenced and caveated.

Why it exercises the concept: SVMs are sensitive to feature scale, so looking at the ranges of each column comes first. This skill profiles the data; it does not fit an SVM.

### [mock-record-generator](https://skillalmanac.com/skills/skill-almanac/mock-record-generator)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Generates seeded mock records as CSV or JSON from a JSON field list or a simple TypeScript interface.

Why it exercises the concept: Seeded mock records give a repeatable table to practise on. They are random, so a fitted boundary says nothing real; use them to learn the steps.

### [Claude Code](https://skillalmanac.com/tools/claude-code)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Claude Code's overview page describes it as an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools.

Why it exercises the concept: A coding agent can write a scikit-learn pipeline with a scaler followed by an SVM and run it on a small table, so you can try different kernels.

## Related terms

- [Classification](https://skillalmanac.com/glossary/classification.md)
- [Supervised learning](https://skillalmanac.com/glossary/supervised-learning.md)
- [Machine learning (ML)](https://skillalmanac.com/glossary/machine-learning.md)
- [Overfitting](https://skillalmanac.com/glossary/overfitting.md)
- [Logistic regression](https://skillalmanac.com/glossary/logistic-regression.md)
- [Feature engineering](https://skillalmanac.com/glossary/feature-engineering.md)

## Sources

- [1.4. Support Vector Machines](https://scikit-learn.org/stable/modules/svm.html), scikit-learn (accessed 2026-11-24)
- [What are support vector machines (SVMs)?](https://www.ibm.com/think/topics/support-vector-machine), IBM (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-25. [Glossary index](https://skillalmanac.com/glossary.md).
