Skip to Content
Python Machine Learning
book

Python Machine Learning

by Wei-Meng Lee
April 2019
Intermediate to advanced
320 pages
6h 42m
English
Wiley
Content preview from Python Machine Learning

CHAPTER 8Supervised Learning—Classification Using Support Vector Machines

What Is a Support Vector Machine?

In the previous chapter, you saw how to perform classification using logistics regression. In this chapter, you will learn another supervised machine learning algorithm that is also very popular among data scientists—Support Vector Machines (SVM). Like logistics regression, SVM is also a classification algorithm.

The main idea behind SVM is to draw a line between two or more classes in the best possible manner (see Figure 8.1).

Illustration of using support vector machines (SVM) to draw a line to separate two classes of animals based on their ear geometry and snout length.

Figure 8.1: Using SVM to separate two classes of animals

Once the line is drawn to separate the classes, you can then use it to predict future data. For example, given the snout length and ear geometry of a new unknown animal, you can now use the dividing line as a classifier to predict if the animal is a dog or a cat.

In this chapter, you will learn how SVM works and the various techniques you can use to adapt SVM for solving nonlinearly‐separable datasets.

Maximum Separability

How does SVM separate two or more classes? Consider the set of points in Figure 8.2. Before you look at the next figure, visually think of a straight line dividing the points into two groups.

Grid chart depicting a set of points that can be separated using support vector machines (SVM).

Figure 8.2: A set of points that can be separated using SVM

Now look at Figure ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python Machine Learning

Python Machine Learning

Sebastian Raschka
Python Machine Learning - Third Edition

Python Machine Learning - Third Edition

Sebastian Raschka, Vahid Mirjalili

Publisher Resources

ISBN: 9781119545637Purchase book