Support Vector
Machine
Classification , Regression and Outliers
detection
OBJECTIVES
• Understand the use of SVM algorithm.
• Demonstrate and interpret SVM using necessary
implementation.
Introductio
n SVM
A Support Vector
Machine (SVM) is a
discriminative classifier
which intakes training
data (supervised
learning), the algorithm
outputs an optimal
hyperplane which
categorizes new
examples.
What could be drawn to classify the black dots from blue
squares?
A line drawn between these data points classify the black dots
and blue squares.
Linearly separable
data
Linear vs Nonlinear separable
data
What could be drawn to classify these data points ( red dots
from blue stars )?
NonLinearly separable data
Here the hyperplane is a 2d plane drawn parallel to x-axis
that is the separator.
NonLinearly separable data
Non Linear data ( type 2 )
Raw Data Line as
Hyperplane
For the previous data the line , if used as
a
Hyperplane
● Two black dots also fall in category
of blue squares
● Data separation is not perfect
● It tolerates some outliers in
the classification
This type of separator best provides the
classification.
But
● It is quite difficult to train a model like this .
● This is termed as Regularisation parameter.
Margi
n Margin is the perpendicular distance between the
closest data points and the Hyperplane ( on both
sides )
The best optimised line ( hyperplane ) with
maximum margin is termed as Margin Maximal
Hyperplane.
The closest points where the margin distance
is calculated are considered as the support
vectors.
Tuning
Parameter
s
SVM
1.
Kernel
Kernel
Choosing the Right Kernel
Linear Kernel: Use it when the data is linearly separable, or
when you have a large number of features compared to the
number of data points.
Polynomial Kernel: Use it for data that exhibits a polynomial
relationship between features.
RBF Kernel: Use it when there is no clear linear relationship,
and the data seems more complex. This is often the default
choice if you're unsure.
KERNEL
Hyperplane
1. Hyperplane:
• A hyperplane is essentially a decision boundary that separates two classes
of data. In two-dimensional space, it is simply a line, and in three-
dimensional space, it’s a plane. For higher dimensions, it is still called a
hyperplane.
2. Margin:
• The margin refers to the distance between the hyperplane and the closest
data points of each class (one on each side of the hyperplane).
• The goal of an SVM is to find the maximum margin, i.e., the hyperplane
that leaves the greatest possible distance between itself and the closest
points from either class. This results in a clearer and more reliable
separation of the two classes.
3. Support Vectors:
• The support vectors are the data points closest to the hyperplane, and
these are critical because they define the margin. The margin is calculated
based on the distance from these points to the hyperplane.
• These points lie right on the boundary of the margin (on either side), and even
if you removed all other points, the position of the hyperplane would remain
the same, as it's entirely determined by these support vectors.
4. Margin Maximal Hyperplane:
• The best-optimized hyperplane is called the Margin Maximal Hyperplane
because it maximizes the margin, meaning it tries to position itself as far away
as possible from the closest data points of both classes. This reduces the
likelihood of misclassifying new data points, as the separation is as clear and
wide as possible.
Applications :
1. Face detection
2. Text and hypertext categorization
3. Classification of images
4. Bioinformatics
5. Handwriting recognition
6. Protein fold and remote homology
detection
7. Generalized predictive control(GPC)

SVM FOR GRADE 11 pearson Btec 3rd level.ppt

  • 1.
    Support Vector Machine Classification ,Regression and Outliers detection
  • 2.
    OBJECTIVES • Understand theuse of SVM algorithm. • Demonstrate and interpret SVM using necessary implementation.
  • 3.
    Introductio n SVM A SupportVector Machine (SVM) is a discriminative classifier which intakes training data (supervised learning), the algorithm outputs an optimal hyperplane which categorizes new examples.
  • 4.
    What could bedrawn to classify the black dots from blue squares?
  • 5.
    A line drawnbetween these data points classify the black dots and blue squares. Linearly separable data
  • 6.
    Linear vs Nonlinearseparable data
  • 7.
    What could bedrawn to classify these data points ( red dots from blue stars )? NonLinearly separable data
  • 8.
    Here the hyperplaneis a 2d plane drawn parallel to x-axis that is the separator. NonLinearly separable data
  • 9.
    Non Linear data( type 2 ) Raw Data Line as Hyperplane
  • 10.
    For the previousdata the line , if used as a Hyperplane ● Two black dots also fall in category of blue squares ● Data separation is not perfect ● It tolerates some outliers in the classification
  • 11.
    This type ofseparator best provides the classification. But ● It is quite difficult to train a model like this . ● This is termed as Regularisation parameter.
  • 12.
    Margi n Margin isthe perpendicular distance between the closest data points and the Hyperplane ( on both sides ) The best optimised line ( hyperplane ) with maximum margin is termed as Margin Maximal Hyperplane. The closest points where the margin distance is calculated are considered as the support vectors.
  • 13.
  • 14.
    Kernel Choosing the RightKernel Linear Kernel: Use it when the data is linearly separable, or when you have a large number of features compared to the number of data points. Polynomial Kernel: Use it for data that exhibits a polynomial relationship between features. RBF Kernel: Use it when there is no clear linear relationship, and the data seems more complex. This is often the default choice if you're unsure.
  • 16.
  • 17.
    Hyperplane 1. Hyperplane: • Ahyperplane is essentially a decision boundary that separates two classes of data. In two-dimensional space, it is simply a line, and in three- dimensional space, it’s a plane. For higher dimensions, it is still called a hyperplane. 2. Margin: • The margin refers to the distance between the hyperplane and the closest data points of each class (one on each side of the hyperplane). • The goal of an SVM is to find the maximum margin, i.e., the hyperplane that leaves the greatest possible distance between itself and the closest points from either class. This results in a clearer and more reliable separation of the two classes.
  • 18.
    3. Support Vectors: •The support vectors are the data points closest to the hyperplane, and these are critical because they define the margin. The margin is calculated based on the distance from these points to the hyperplane. • These points lie right on the boundary of the margin (on either side), and even if you removed all other points, the position of the hyperplane would remain the same, as it's entirely determined by these support vectors. 4. Margin Maximal Hyperplane: • The best-optimized hyperplane is called the Margin Maximal Hyperplane because it maximizes the margin, meaning it tries to position itself as far away as possible from the closest data points of both classes. This reduces the likelihood of misclassifying new data points, as the separation is as clear and wide as possible.
  • 20.
    Applications : 1. Facedetection 2. Text and hypertext categorization 3. Classification of images 4. Bioinformatics 5. Handwriting recognition 6. Protein fold and remote homology detection 7. Generalized predictive control(GPC)

Editor's Notes

  • #19 The support vectors are the points that lie closest to the hyperplane and help define the margin. They satisfy the condition: