1 of 12

Reconhecimento de Padrões (RPD-0041)

Lecture 3b: A Tour of Machine Learning Classifiers Using scikit-learn - Support Vector Machine

2 of 12

General Idea

  • Select the model “type”

  • Select a loss function

  • Select as optimization method

  • Find the solution

3 of 12

Support Vector Machine

  • Which of the two linear classifiers below would you choose?

Intuitively, the one that provides the largest separation margin!

4 of 12

Maximum Margin Intuition

5 of 12

SVM optimization

The left side of the preceding equation can then be interpreted as the distance between the positive and negative hyperplane, which is the so-called margin that we want to maximize. Now, the objective function of the SVM becomes the maximization of this margin by:�

6 of 12

Support Vector Machine

7 of 12

Support Vector Machine

λi non-zero →

support vectors

8 of 12

Support Vector Machine

  • Non-linearly separable case:

Three cases:

  • Patterns outside the margin, correctly classified;

  • Patterns inside the margin, correctly classified:

  • Patterns inside the margin, incorrectly classified:

9 of 12

Support Vector Machine

  • The optimization problem could be written with the objective of maximizing the margin, penalizing patterns inside the margin and incorrectly classified patterns:

10 of 12

Dealing with a nonlinearly separable case�using slack variables

  • Soft-margin classification:�

11 of 12

Support Vector Machine

Influence of parameter C:

What does this mean?

Relationship with regularization!

12 of 12

SVM using scikit-learn