Support vector machine

Support Vector Machine (SVM)

Supervised Learning

Definition

Looks for the boundary between the classes that has the largest possible margin from the nearest instances (the support vectors).

Core idea

A wide margin means better generalization. With the kernel trick (Kernel Trick, such as RBF) it can draw non-linear boundaries without computing the new features explicitly.

The decision boundary with the largest margin; the points on the margin are the support vectors.

How it works

  1. We normalize the features
  2. We choose the kernel: linear, RBF or polynomial
  3. We solve an optimization problem that maximizes the margin while allowing some errors (C)
  4. The instances on the margin are the support vectors that define the model

Data type and problem type

Data typeNormalized numeric tabular data; and text representations
Problem typeClassification and regression (SVR)

Strengths

  • Strong performance on medium-sized data with many dimensions
  • Flexible thanks to kernels

Limitations

  • Slow with very large data
  • Sensitive to the choice of C and gamma
  • Does not give probabilities directly

Key parameters

  • C
  • The kernel type (kernel)
  • gamma for the RBF kernel

Evaluation metrics

  • Accuracy
  • Precision and Recall
  • F1-score
  • Confusion Matrix
  • ROC AUC for binary classification

Supporting tools

OrangeSVM
KNIMESVM Learner + SVM Predictor
WEKAfunctions.SMO

Applied examples

  • Classifying breast tumours (for teaching)
  • Text classification
  • Digit recognition

Related projects

Alternative algorithms

Try it in the lab