ML Models & Algorithms
Support Vector Machine (SVM)
In shortA classification model that finds the boundary separating classes with the widest possible margin; strong on text features like TF-IDF.
A support vector machine (SVM) is a supervised machine learning model mainly used for classification. It separates two classes by finding the boundary (a hyperplane) that leaves the widest possible gap, or margin, between them. SVMs were a leading method for text classification before deep learning and are still a strong, fast choice for small and medium datasets.
How it works
- Each example is a point in a space with one dimension per feature, for example one per word in a TF-IDF vector.
- The SVM finds the boundary that separates the classes with the largest margin. Only the points closest to the boundary, the support vectors, determine where it sits.
- The C parameter controls the trade-off between a wide margin and classifying every training point correctly, which helps when the data is noisy.
- When classes cannot be separated with a straight line, the kernel trick (for example the RBF kernel) lets the SVM draw curved boundaries without computing the extra dimensions explicitly.
SVMs are binary at heart. For three or more classes they use one-vs-one or one-vs-rest strategies, which libraries such as scikit-learn apply automatically. They output class decisions rather than probabilities, although probability estimates can be added.
How it’s used in SEO and marketing
- Sentiment classification of reviews, social posts or ad copy.
- Search intent classification of keywords from text features.
- Page type identification from on-page features.
- Spam or low-quality content detection.
- Audience segmentation when you already have labelled segments.
Example
MLforSEO’s sentiment deep dive cites research by da Silva and colleagues (2016) that classified Twitter data with an SVM, using a small labelled set to improve accuracy in a semi-supervised setup. A marketing version: label 500 product reviews as positive, negative or neutral, convert them to TF-IDF vectors, train a linear SVM, and check precision and recall per class on a held-out set before classifying the remaining 20,000.
Limitations and things to watch
- Training slows down a lot on very large datasets, especially with non-linear kernels.
- Features need scaling, and kernel and C settings need tuning.
- Results are harder to explain than logistic regression or a decision tree.
- For nuanced language, fine-tuned transformer models or LLMs usually perform better, at a higher cost.
Learn it on MLforSEO
Sources and further reading
Other terms from ML Models & Algorithms
- BERT (Bidirectional Encoder Representations from Transformers)Google's 2018 transformer language model that reads text in both directions to produce context-aware embedding…
- BERTopicA modular topic modelling technique that clusters transformer embeddings and labels each cluster with class-ba…
- BIRCH (Balanced Iterative Reducing and Clustering using Hierarchies)BIRCH (Balanced Iterative Reducing and Clustering using Hierarchies) clusters very large numeric datasets by s…
- BM25A classic ranking function that scores documents by how often query words appear, adjusted for word rarity and…
- Boyer-MooreA fast exact string-search algorithm that compares a pattern from right to left and skips ahead after mismatch…
- c-TF-IDFClass-based TF-IDF: treats each cluster as one document to find the words that best describe it, used by BERTo…
- Centroid-based ClusteringA clustering family that groups data around central points (centroids), each the average of its cluster's memb…
- Convolutional Neural Network (CNN)A deep learning architecture that scans data with small learned filters to detect local patterns; the classic…
- DBSCANDensity-based clustering that groups closely packed points, finds the number of clusters itself and labels iso…