LearnViz CompSci
Home / Learn / AI & Machine Learning / Support Vector Machines

Intermediate Topic 22 of 51 AI & Machine Learning

Support Vector Machines

Classifiers maximizing the margin between classes.

How it works

A support vector machine finds the hyperplane that separates classes with the maximum margin, the widest gap between the boundary and the nearest points, called support vectors, which alone determine the boundary. Soft-margin versions allow some misclassifications controlled by a parameter C. The kernel trick implicitly maps data to a higher-dimensional space, using kernels such as polynomial and radial basis function, to find nonlinear boundaries. Support vector regression applies the idea to continuous targets.

Step-by-step walkthrough

  1. Find a boundary that separates the classes.
  2. Many lines work, choose the one with the widest margin.
  3. The points touching the margin are the support vectors.
  4. Only they define the boundary.
  5. The kernel trick allows curved boundaries.

Where it is used

Text classification, image recognition before deep learning, bioinformatics and small to medium datasets with many features use SVMs.

Common pitfall

Training scales poorly, roughly quadratic or worse in the number of samples, so large datasets are slow. Performance depends on kernel and hyperparameters C and gamma, requiring tuning with cross-validation. Features must be scaled. Outputs are not probabilities unless calibrated. For very large data, linear SVMs or gradient boosting and neural networks are often preferred.

Where it fits in the course

Support Vector Machines is topic 22 of 51 in AI & Machine Learning, rated Intermediate. It follows Naive Bayes. The next topic is Random Forests.

Practice and explore

How to study this topic

  1. Read the explanation above and restate the definition in your own words.
  2. Open the interactive lesson and answer its mini quiz.
  3. Read the common pitfall, then write a short example that avoids it.
  4. Check your understanding in the AI & Machine Learning quiz, and revisit the topic if you miss a question.

Frequently asked questions

What is Support Vector Machines?
Classifiers maximizing the margin between classes. It belongs to AI & Machine Learning and is an intermediate-level topic.
Where do people use Support Vector Machines?
Text classification, image recognition before deep learning, bioinformatics and small to medium datasets with many features use SVMs.
What is the most common mistake with Support Vector Machines?
Training scales poorly, roughly quadratic or worse in the number of samples, so large datasets are slow.
What should I learn before this topic?
Start with Naive Bayes, the topic just before it in AI & Machine Learning.
How can I practice it?
Answer the mini quiz in the interactive lesson, then take the AI & Machine Learning quiz.
Is Support Vector Machines hard to learn?
It is an Intermediate topic. Be comfortable with the Beginner topics in this area first, then read the common pitfall carefully, since it is where most mistakes happen.
How long does it take to learn Support Vector Machines?
Most learners can read the explanation and finish the interactive lesson in under an hour. Fluency comes from applying the idea, so plan a few short practice sessions with the quiz.
Which topics are related to Support Vector Machines?
Naive Bayes, Random Forests, Regularization are closely connected. The full list is in the related topics section of this page.
What should I study after Support Vector Machines?
Continue with Random Forests, the next topic in AI & Machine Learning.

Related topics