Support Vector Machines- SVM

Carlo Carandang
Carlo CarandangPsychiatrist, Data Scientist
Support Vector Machines
Carlo Carandang, Seyoon Han, Kyle Lindsay, Michael Nisbet
NSCC Presentation
April 3, 2017
Support Vector Machines
• In this presentation, we approach a two-class classification problem.
• We try to find a plane that separates the class in the feature space,
also called a hyperplane.
• If we can’t find the hyperplane, then we can be creative in two ways:
1. We soften what we mean by separate, and
2. We enrich and enlarge the featured space so that separation is possible
What Is a Hyperplane
Hyperplane in 2 Dimensions
Separating Hyperplanes
Maximal Margin Classifier
*This can be rephrased as a convex quadratic program and solved
efficiently. The function svm() in package e1071 solves this problem
efficiently.
The data on the left are not
separable by a linear boundary.
This is often the case, unless N < p.
Non-separable Data
Noisy Data
Sometimes the data are separable, but noisy. This can lead to a poor
solution for the maximal-margin classifier.
The support vector classifier maximizes a soft margin.
Support Vector Classifier
C is a Regularization parameter
Linear boundary can fail
Sometimes a linear boundary simply
won’t work, no matter what value
of C.
The example is on the left is the
case.
What to do?
Support Vector Classifier and Non-Linear
Class Boundaries
• The support vector classifier is a natural approach for classification in
the two-class setting, if the boundary between the two classes is
linear
• However, in practice we are sometimes faced with non-linear class
boundaries
• In this case, the soft margin is not going to help
Support Vector Machines- SVM
Feature Expansion- Linear Regression
• In Chapter 7, we saw that linear regression suffers when there is a
non-linear relationship between predictors (independent variables)
and the outcome measures (dependent variables)
• The solution is enlarging the feature space using functions of the
predictors, such as quadratics and cubic terms, in order to address
this non-linearity:
• ax2 + bx + c = 0 (quadratic)
• ax3 + bx2 + cx + d = 0 (cubic)
Feature Expansion- Support Vector Classifier
• So for Support Vector Classifier, we can address non-linear boundaries
between classes in a similar way, by enlarging the feature space using
quadratic, cubic, and higher-order polynomial functions of the
predictors
• For instance, rather than fitting a support vector classifier using p
features:
X1, X2, . . . , Xp
• We can instead fit a support vector classifier using 2p features:
X1, X1
2, X2, X2
2, . . . , Xp, Xp
2
Support Vector Machine
• This results in non-linear decision
boundaries in the original space
• Here is a cubic polynomial (X3)-
degree 3
• Decision boundary split in two
• Conic section of a cubic polynomial
• This feature expansion of the support
vector classifier known as the
SUPPORT VECTOR MACHINE
• Β0 + β1X1 + β2X2 + β3X1
2 + β4X2
2 + β5X1X2
+ β6X1
3 + β7X2
3 + β8X1X 2
2 + β9X1
2X2 = 0
Non-Linearities and Kernels
• Polynomials (especially high-dimensional ones) get wild rather fast
• In regression, we don’t like doing polynomial regression with degree
larger than 3
• In support-vector classifiers, there is a more elegant and controlled
way to introduce nonlinearities— through the use of kernels
• Before we discuss these, we must understand the role of inner
products in support-vector classifiers
Support Vector Machines- SVM
Inner Products and Support Vectors
• If we can compute the inner products between all pairs of
observations and if we can also compute the inner products between
all the training observations and a new test point, then we can both
fit the support vector machine and evaluate the function
Support Vectors
Support Vectors
• Support vectors (support points) are the alphas that are not zero
• If a point is not a support point, then it is on the right side of the
margin, and it does not affect the direction of the decision boundary
• The alphas are assigning weights to the data points, and the ones that
are zero (right side of the margin) have no bearing on the solution,
while the data points that are not zero (support points) affect the
solution
Kernels and Support Vector Machines
• Computing the inner products between observations can be quite
abstract
• Kernel functions can help and do this abstract math and compute the
inner products for us:
Kernels and Support Vector Machines
• We don't need to actually visit the feature space because this kernel
function will compute those inner products- sort of like magic
• You've got a kernel function the computes this inner product in this
very high dimensional space
• The support vector machine (SVM) is an extension of the support
vector classifier that results from enlarging the feature space in a
specific way using kernels
Radial Kernel
• Radial kernels are very popular
• One of the most popular kernels that's used for non-linear support
vector machines
• With feature expansion of support vector classifier, you'd run into
trouble raising power to 1,000,000
• But with a polynomial kernel in SVMs, you could get away with that
because of all the squishing of the dimensions to zero
Support Vector Machines- SVM
Support Vector Machines- SVM
Support Vector Machines- SVM
Reference:
Stanford University HumanitiesScience StatLearning:
https://lagunita.stanford.edu/c4x/HumanitiesSciences/StatLearning/as
set/svm-handout.pdf
1 of 28

Recommended

Support Vector Machines by
Support Vector MachinesSupport Vector Machines
Support Vector Machinesnextlib
19.9K views56 slides
Support vector machine by
Support vector machineSupport vector machine
Support vector machineRishabh Gupta
1.1K views43 slides
Support Vector Machine - How Support Vector Machine works | SVM in Machine Le... by
Support Vector Machine - How Support Vector Machine works | SVM in Machine Le...Support Vector Machine - How Support Vector Machine works | SVM in Machine Le...
Support Vector Machine - How Support Vector Machine works | SVM in Machine Le...Simplilearn
10.2K views70 slides
Support Vector Machine by
Support Vector MachineSupport Vector Machine
Support Vector MachineShao-Chuan Wang
33.7K views24 slides
Support vector machines (svm) by
Support vector machines (svm)Support vector machines (svm)
Support vector machines (svm)Sharayu Patil
1.2K views23 slides
Support vector machine by
Support vector machineSupport vector machine
Support vector machinezekeLabs Technologies
2.3K views29 slides

More Related Content

What's hot

Support Vector Machine ppt presentation by
Support Vector Machine ppt presentationSupport Vector Machine ppt presentation
Support Vector Machine ppt presentationAyanaRukasar
2.1K views26 slides
Support vector machine by
Support vector machineSupport vector machine
Support vector machineMusa Hawamdah
5.8K views32 slides
2.6 support vector machines and associative classifiers revised by
2.6 support vector machines and associative classifiers revised2.6 support vector machines and associative classifiers revised
2.6 support vector machines and associative classifiers revisedKrish_ver2
2.1K views12 slides
Support vector machine by
Support vector machineSupport vector machine
Support vector machineSomnathMore3
628 views20 slides
Support Vector Machines ( SVM ) by
Support Vector Machines ( SVM ) Support Vector Machines ( SVM )
Support Vector Machines ( SVM ) Mohammad Junaid Khan
35.8K views26 slides
Support Vector Machines (SVM) by
Support Vector Machines (SVM)Support Vector Machines (SVM)
Support Vector Machines (SVM)FAO
2.5K views14 slides

What's hot(20)

Support Vector Machine ppt presentation by AyanaRukasar
Support Vector Machine ppt presentationSupport Vector Machine ppt presentation
Support Vector Machine ppt presentation
AyanaRukasar2.1K views
Support vector machine by Musa Hawamdah
Support vector machineSupport vector machine
Support vector machine
Musa Hawamdah5.8K views
2.6 support vector machines and associative classifiers revised by Krish_ver2
2.6 support vector machines and associative classifiers revised2.6 support vector machines and associative classifiers revised
2.6 support vector machines and associative classifiers revised
Krish_ver22.1K views
Support vector machine by SomnathMore3
Support vector machineSupport vector machine
Support vector machine
SomnathMore3628 views
Support Vector Machines (SVM) by FAO
Support Vector Machines (SVM)Support Vector Machines (SVM)
Support Vector Machines (SVM)
FAO2.5K views
Support vector machines by Ujjawal
Support vector machinesSupport vector machines
Support vector machines
Ujjawal 973 views
Understanding Bagging and Boosting by Mohit Rajput
Understanding Bagging and BoostingUnderstanding Bagging and Boosting
Understanding Bagging and Boosting
Mohit Rajput2.8K views
Linear regression by MartinHogg9
Linear regressionLinear regression
Linear regression
MartinHogg912.2K views
Svm and kernel machines by Nawal Sharma
Svm and kernel machinesSvm and kernel machines
Svm and kernel machines
Nawal Sharma2.7K views
Introduction to Linear Discriminant Analysis by Jaclyn Kokx
Introduction to Linear Discriminant AnalysisIntroduction to Linear Discriminant Analysis
Introduction to Linear Discriminant Analysis
Jaclyn Kokx7.1K views
Machine Learning using Support Vector Machine by Mohsin Ul Haq
Machine Learning using Support Vector MachineMachine Learning using Support Vector Machine
Machine Learning using Support Vector Machine
Mohsin Ul Haq2K views
What is the Expectation Maximization (EM) Algorithm? by Kazuki Yoshida
What is the Expectation Maximization (EM) Algorithm?What is the Expectation Maximization (EM) Algorithm?
What is the Expectation Maximization (EM) Algorithm?
Kazuki Yoshida4.9K views
Pattern recognition and Machine Learning. by Rohit Kumar
Pattern recognition and Machine Learning.Pattern recognition and Machine Learning.
Pattern recognition and Machine Learning.
Rohit Kumar15.5K views
Machine Learning and Real-World Applications by MachinePulse
Machine Learning and Real-World ApplicationsMachine Learning and Real-World Applications
Machine Learning and Real-World Applications
MachinePulse23.8K views
Svm Presentation by shahparin
Svm PresentationSvm Presentation
Svm Presentation
shahparin1.1K views

Similar to Support Vector Machines- SVM

Module-3_SVM_Kernel_KNN.pptx by
Module-3_SVM_Kernel_KNN.pptxModule-3_SVM_Kernel_KNN.pptx
Module-3_SVM_Kernel_KNN.pptxVaishaliBagewadikar
12 views51 slides
support vector machine 1.pptx by
support vector machine 1.pptxsupport vector machine 1.pptx
support vector machine 1.pptxsurbhidutta4
48 views25 slides
svm.pptx by
svm.pptxsvm.pptx
svm.pptxPriyadharshiniG41
16 views22 slides
Anomaly Detection and Localization Using GAN and One-Class Classifier by
Anomaly Detection and Localization  Using GAN and One-Class ClassifierAnomaly Detection and Localization  Using GAN and One-Class Classifier
Anomaly Detection and Localization Using GAN and One-Class Classifier홍배 김
2.1K views15 slides
sentiment analysis using support vector machine by
sentiment analysis using support vector machinesentiment analysis using support vector machine
sentiment analysis using support vector machineShital Andhale
1.2K views23 slides
lec10svm.ppt by
lec10svm.pptlec10svm.ppt
lec10svm.pptpushkarjoshi42
4 views35 slides

Similar to Support Vector Machines- SVM(20)

support vector machine 1.pptx by surbhidutta4
support vector machine 1.pptxsupport vector machine 1.pptx
support vector machine 1.pptx
surbhidutta448 views
Anomaly Detection and Localization Using GAN and One-Class Classifier by 홍배 김
Anomaly Detection and Localization  Using GAN and One-Class ClassifierAnomaly Detection and Localization  Using GAN and One-Class Classifier
Anomaly Detection and Localization Using GAN and One-Class Classifier
홍배 김2.1K views
sentiment analysis using support vector machine by Shital Andhale
sentiment analysis using support vector machinesentiment analysis using support vector machine
sentiment analysis using support vector machine
Shital Andhale1.2K views
Svm ms by student
Svm msSvm ms
Svm ms
student29 views
properties, application and issues of support vector machine by Dr. Radhey Shyam
properties, application and issues of support vector machineproperties, application and issues of support vector machine
properties, application and issues of support vector machine
Dr. Radhey Shyam755 views
Data Science - Part IX - Support Vector Machine by Derek Kane
Data Science - Part IX -  Support Vector MachineData Science - Part IX -  Support Vector Machine
Data Science - Part IX - Support Vector Machine
Derek Kane6.4K views
OM-DS-Fall2022-Session10-Support vector machine.pdf by ssuserb016ab
OM-DS-Fall2022-Session10-Support vector machine.pdfOM-DS-Fall2022-Session10-Support vector machine.pdf
OM-DS-Fall2022-Session10-Support vector machine.pdf
ssuserb016ab10 views
1629 stochastic subgradient approach for solving linear support vector by Dr Fereidoun Dejahang
1629 stochastic subgradient approach for solving linear support vector1629 stochastic subgradient approach for solving linear support vector
1629 stochastic subgradient approach for solving linear support vector
Supervised and unsupervised learning by AmAn Singh
Supervised and unsupervised learningSupervised and unsupervised learning
Supervised and unsupervised learning
AmAn Singh323 views
Overview of Convolutional Neural Networks by ananth
Overview of Convolutional Neural NetworksOverview of Convolutional Neural Networks
Overview of Convolutional Neural Networks
ananth7.7K views
svm-proyekt.pptx by ElinEliyev
svm-proyekt.pptxsvm-proyekt.pptx
svm-proyekt.pptx
ElinEliyev26 views

More from Carlo Carandang

Psychosis in Youth by
Psychosis in YouthPsychosis in Youth
Psychosis in YouthCarlo Carandang
544 views44 slides
Metyrosine and Psychosis by
Metyrosine and PsychosisMetyrosine and Psychosis
Metyrosine and PsychosisCarlo Carandang
374 views40 slides
Lamotrigine for Treatment Refractory Mood Disorders in Adolescents: A Case Se... by
Lamotrigine for Treatment Refractory Mood Disorders in Adolescents: A Case Se...Lamotrigine for Treatment Refractory Mood Disorders in Adolescents: A Case Se...
Lamotrigine for Treatment Refractory Mood Disorders in Adolescents: A Case Se...Carlo Carandang
380 views42 slides
Anxiety Disorders by
Anxiety DisordersAnxiety Disorders
Anxiety DisordersCarlo Carandang
397 views25 slides
Metyrosine in Adolescent Psychosis Associated with 22q11.2 Deletion Syndrome by
Metyrosine in Adolescent Psychosis Associated with 22q11.2 Deletion SyndromeMetyrosine in Adolescent Psychosis Associated with 22q11.2 Deletion Syndrome
Metyrosine in Adolescent Psychosis Associated with 22q11.2 Deletion SyndromeCarlo Carandang
379 views35 slides
Velocardiofacial Syndrome Associated with Adolescent Psychosis by
Velocardiofacial Syndrome Associated with Adolescent PsychosisVelocardiofacial Syndrome Associated with Adolescent Psychosis
Velocardiofacial Syndrome Associated with Adolescent PsychosisCarlo Carandang
421 views40 slides

More from Carlo Carandang(20)

Lamotrigine for Treatment Refractory Mood Disorders in Adolescents: A Case Se... by Carlo Carandang
Lamotrigine for Treatment Refractory Mood Disorders in Adolescents: A Case Se...Lamotrigine for Treatment Refractory Mood Disorders in Adolescents: A Case Se...
Lamotrigine for Treatment Refractory Mood Disorders in Adolescents: A Case Se...
Carlo Carandang380 views
Metyrosine in Adolescent Psychosis Associated with 22q11.2 Deletion Syndrome by Carlo Carandang
Metyrosine in Adolescent Psychosis Associated with 22q11.2 Deletion SyndromeMetyrosine in Adolescent Psychosis Associated with 22q11.2 Deletion Syndrome
Metyrosine in Adolescent Psychosis Associated with 22q11.2 Deletion Syndrome
Carlo Carandang379 views
Velocardiofacial Syndrome Associated with Adolescent Psychosis by Carlo Carandang
Velocardiofacial Syndrome Associated with Adolescent PsychosisVelocardiofacial Syndrome Associated with Adolescent Psychosis
Velocardiofacial Syndrome Associated with Adolescent Psychosis
Carlo Carandang421 views
Clinical Assessment of Children and Adolescents with Depression by Carlo Carandang
Clinical Assessment of Children and Adolescents with DepressionClinical Assessment of Children and Adolescents with Depression
Clinical Assessment of Children and Adolescents with Depression
Carlo Carandang513 views
Data Safety Monitoring Boards in Pediatric Clinical Trials by Carlo Carandang
Data Safety Monitoring Boards in Pediatric Clinical TrialsData Safety Monitoring Boards in Pediatric Clinical Trials
Data Safety Monitoring Boards in Pediatric Clinical Trials
Carlo Carandang305 views
The Neurobiology of Adolescent Development by Carlo Carandang
The Neurobiology of Adolescent DevelopmentThe Neurobiology of Adolescent Development
The Neurobiology of Adolescent Development
Carlo Carandang234 views
Canadian Psychiatry: The Case for Universal Health Care and How Psychiatry Be... by Carlo Carandang
Canadian Psychiatry: The Case for Universal Health Care and How Psychiatry Be...Canadian Psychiatry: The Case for Universal Health Care and How Psychiatry Be...
Canadian Psychiatry: The Case for Universal Health Care and How Psychiatry Be...
Carlo Carandang252 views
Clinical assessment of child and adolescent psychiatric emergencies by Carlo Carandang
Clinical assessment of child and adolescent psychiatric emergenciesClinical assessment of child and adolescent psychiatric emergencies
Clinical assessment of child and adolescent psychiatric emergencies
Carlo Carandang429 views
AI and Big Data in Psychiatry: An Introduction and Overview by Carlo Carandang
AI and Big Data in Psychiatry: An Introduction and OverviewAI and Big Data in Psychiatry: An Introduction and Overview
AI and Big Data in Psychiatry: An Introduction and Overview
Carlo Carandang1.5K views
Air Pollution in Nova Scotia: Analysis and Predictions by Carlo Carandang
Air Pollution in Nova Scotia: Analysis and PredictionsAir Pollution in Nova Scotia: Analysis and Predictions
Air Pollution in Nova Scotia: Analysis and Predictions
Carlo Carandang277 views
Workplace Disability from Stress, Anxiety, and Depression: Solutions and Prev... by Carlo Carandang
Workplace Disability from Stress, Anxiety, and Depression: Solutions and Prev...Workplace Disability from Stress, Anxiety, and Depression: Solutions and Prev...
Workplace Disability from Stress, Anxiety, and Depression: Solutions and Prev...
Carlo Carandang196 views
Analysis of Air Pollution in Nova Scotia Presentation by Carlo Carandang
Analysis of Air Pollution in Nova Scotia PresentationAnalysis of Air Pollution in Nova Scotia Presentation
Analysis of Air Pollution in Nova Scotia Presentation
Carlo Carandang233 views
Paxil Study 329 Retracted: A Critical Statistical Analysis by Carlo Carandang
Paxil Study 329 Retracted: A Critical Statistical AnalysisPaxil Study 329 Retracted: A Critical Statistical Analysis
Paxil Study 329 Retracted: A Critical Statistical Analysis
Carlo Carandang221 views

Recently uploaded

DGST Methodology Presentation.pdf by
DGST Methodology Presentation.pdfDGST Methodology Presentation.pdf
DGST Methodology Presentation.pdfmaddierlegum
7 views9 slides
[DSC Europe 23][DigiHealth] Muthu Ramachandran AI and Blockchain Framework fo... by
[DSC Europe 23][DigiHealth] Muthu Ramachandran AI and Blockchain Framework fo...[DSC Europe 23][DigiHealth] Muthu Ramachandran AI and Blockchain Framework fo...
[DSC Europe 23][DigiHealth] Muthu Ramachandran AI and Blockchain Framework fo...DataScienceConferenc1
9 views77 slides
VoxelNet by
VoxelNetVoxelNet
VoxelNettaeseon ryu
17 views21 slides
META.pptx by
META.pptxMETA.pptx
META.pptxvasanthan19012003
6 views10 slides
Report on OSINT by
Report on OSINTReport on OSINT
Report on OSINTAyonDebnathCertified
5 views15 slides
[DSC Europe 23] Stefan Mrsic_Goran Savic - Evolving Technology Excellence.pptx by
[DSC Europe 23] Stefan Mrsic_Goran Savic - Evolving Technology Excellence.pptx[DSC Europe 23] Stefan Mrsic_Goran Savic - Evolving Technology Excellence.pptx
[DSC Europe 23] Stefan Mrsic_Goran Savic - Evolving Technology Excellence.pptxDataScienceConferenc1
11 views16 slides

Recently uploaded(20)

DGST Methodology Presentation.pdf by maddierlegum
DGST Methodology Presentation.pdfDGST Methodology Presentation.pdf
DGST Methodology Presentation.pdf
maddierlegum7 views
[DSC Europe 23][DigiHealth] Muthu Ramachandran AI and Blockchain Framework fo... by DataScienceConferenc1
[DSC Europe 23][DigiHealth] Muthu Ramachandran AI and Blockchain Framework fo...[DSC Europe 23][DigiHealth] Muthu Ramachandran AI and Blockchain Framework fo...
[DSC Europe 23][DigiHealth] Muthu Ramachandran AI and Blockchain Framework fo...
[DSC Europe 23] Stefan Mrsic_Goran Savic - Evolving Technology Excellence.pptx by DataScienceConferenc1
[DSC Europe 23] Stefan Mrsic_Goran Savic - Evolving Technology Excellence.pptx[DSC Europe 23] Stefan Mrsic_Goran Savic - Evolving Technology Excellence.pptx
[DSC Europe 23] Stefan Mrsic_Goran Savic - Evolving Technology Excellence.pptx
PRIVACY AWRE PERSONAL DATA STORAGE by antony420421
PRIVACY AWRE PERSONAL DATA STORAGEPRIVACY AWRE PERSONAL DATA STORAGE
PRIVACY AWRE PERSONAL DATA STORAGE
antony4204217 views
6498-Butun_Beyinli_Cocuq-Daniel_J.Siegel-Tina_Payne_Bryson-2011-259s.pdf by 10urkyr34
6498-Butun_Beyinli_Cocuq-Daniel_J.Siegel-Tina_Payne_Bryson-2011-259s.pdf6498-Butun_Beyinli_Cocuq-Daniel_J.Siegel-Tina_Payne_Bryson-2011-259s.pdf
6498-Butun_Beyinli_Cocuq-Daniel_J.Siegel-Tina_Payne_Bryson-2011-259s.pdf
10urkyr347 views
Customer Data Cleansing Project.pptx by Nat O
Customer Data Cleansing Project.pptxCustomer Data Cleansing Project.pptx
Customer Data Cleansing Project.pptx
Nat O6 views
CRIJ4385_Death Penalty_F23.pptx by yvettemm100
CRIJ4385_Death Penalty_F23.pptxCRIJ4385_Death Penalty_F23.pptx
CRIJ4385_Death Penalty_F23.pptx
yvettemm1007 views
Data about the sector workshop by info828217
Data about the sector workshopData about the sector workshop
Data about the sector workshop
info82821729 views
[DSC Europe 23] Luca Morena - From Psychohistory to Curious Machines by DataScienceConferenc1
[DSC Europe 23] Luca Morena - From Psychohistory to Curious Machines[DSC Europe 23] Luca Morena - From Psychohistory to Curious Machines
[DSC Europe 23] Luca Morena - From Psychohistory to Curious Machines
LIVE OAK MEMORIAL PARK.pptx by ms2332always
LIVE OAK MEMORIAL PARK.pptxLIVE OAK MEMORIAL PARK.pptx
LIVE OAK MEMORIAL PARK.pptx
ms2332always7 views
Product Research sample.pdf by AllenSingson
Product Research sample.pdfProduct Research sample.pdf
Product Research sample.pdf
AllenSingson33 views
OPPOTUS - Malaysians on Malaysia 3Q2023.pdf by Oppotus
OPPOTUS - Malaysians on Malaysia 3Q2023.pdfOPPOTUS - Malaysians on Malaysia 3Q2023.pdf
OPPOTUS - Malaysians on Malaysia 3Q2023.pdf
Oppotus30 views
[DSC Europe 23] Matteo Molteni - Implementing a Robust CI Workflow with dbt f... by DataScienceConferenc1
[DSC Europe 23] Matteo Molteni - Implementing a Robust CI Workflow with dbt f...[DSC Europe 23] Matteo Molteni - Implementing a Robust CI Workflow with dbt f...
[DSC Europe 23] Matteo Molteni - Implementing a Robust CI Workflow with dbt f...
Lack of communication among family.pptx by ahmed164023
Lack of communication among family.pptxLack of communication among family.pptx
Lack of communication among family.pptx
ahmed16402314 views

Support Vector Machines- SVM

  • 1. Support Vector Machines Carlo Carandang, Seyoon Han, Kyle Lindsay, Michael Nisbet NSCC Presentation April 3, 2017
  • 2. Support Vector Machines • In this presentation, we approach a two-class classification problem. • We try to find a plane that separates the class in the feature space, also called a hyperplane. • If we can’t find the hyperplane, then we can be creative in two ways: 1. We soften what we mean by separate, and 2. We enrich and enlarge the featured space so that separation is possible
  • 3. What Is a Hyperplane
  • 4. Hyperplane in 2 Dimensions
  • 6. Maximal Margin Classifier *This can be rephrased as a convex quadratic program and solved efficiently. The function svm() in package e1071 solves this problem efficiently.
  • 7. The data on the left are not separable by a linear boundary. This is often the case, unless N < p. Non-separable Data
  • 8. Noisy Data Sometimes the data are separable, but noisy. This can lead to a poor solution for the maximal-margin classifier. The support vector classifier maximizes a soft margin.
  • 10. C is a Regularization parameter
  • 11. Linear boundary can fail Sometimes a linear boundary simply won’t work, no matter what value of C. The example is on the left is the case. What to do?
  • 12. Support Vector Classifier and Non-Linear Class Boundaries • The support vector classifier is a natural approach for classification in the two-class setting, if the boundary between the two classes is linear • However, in practice we are sometimes faced with non-linear class boundaries • In this case, the soft margin is not going to help
  • 14. Feature Expansion- Linear Regression • In Chapter 7, we saw that linear regression suffers when there is a non-linear relationship between predictors (independent variables) and the outcome measures (dependent variables) • The solution is enlarging the feature space using functions of the predictors, such as quadratics and cubic terms, in order to address this non-linearity: • ax2 + bx + c = 0 (quadratic) • ax3 + bx2 + cx + d = 0 (cubic)
  • 15. Feature Expansion- Support Vector Classifier • So for Support Vector Classifier, we can address non-linear boundaries between classes in a similar way, by enlarging the feature space using quadratic, cubic, and higher-order polynomial functions of the predictors • For instance, rather than fitting a support vector classifier using p features: X1, X2, . . . , Xp • We can instead fit a support vector classifier using 2p features: X1, X1 2, X2, X2 2, . . . , Xp, Xp 2
  • 16. Support Vector Machine • This results in non-linear decision boundaries in the original space • Here is a cubic polynomial (X3)- degree 3 • Decision boundary split in two • Conic section of a cubic polynomial • This feature expansion of the support vector classifier known as the SUPPORT VECTOR MACHINE • Β0 + β1X1 + β2X2 + β3X1 2 + β4X2 2 + β5X1X2 + β6X1 3 + β7X2 3 + β8X1X 2 2 + β9X1 2X2 = 0
  • 17. Non-Linearities and Kernels • Polynomials (especially high-dimensional ones) get wild rather fast • In regression, we don’t like doing polynomial regression with degree larger than 3 • In support-vector classifiers, there is a more elegant and controlled way to introduce nonlinearities— through the use of kernels • Before we discuss these, we must understand the role of inner products in support-vector classifiers
  • 19. Inner Products and Support Vectors • If we can compute the inner products between all pairs of observations and if we can also compute the inner products between all the training observations and a new test point, then we can both fit the support vector machine and evaluate the function
  • 21. Support Vectors • Support vectors (support points) are the alphas that are not zero • If a point is not a support point, then it is on the right side of the margin, and it does not affect the direction of the decision boundary • The alphas are assigning weights to the data points, and the ones that are zero (right side of the margin) have no bearing on the solution, while the data points that are not zero (support points) affect the solution
  • 22. Kernels and Support Vector Machines • Computing the inner products between observations can be quite abstract • Kernel functions can help and do this abstract math and compute the inner products for us:
  • 23. Kernels and Support Vector Machines • We don't need to actually visit the feature space because this kernel function will compute those inner products- sort of like magic • You've got a kernel function the computes this inner product in this very high dimensional space • The support vector machine (SVM) is an extension of the support vector classifier that results from enlarging the feature space in a specific way using kernels
  • 24. Radial Kernel • Radial kernels are very popular • One of the most popular kernels that's used for non-linear support vector machines • With feature expansion of support vector classifier, you'd run into trouble raising power to 1,000,000 • But with a polynomial kernel in SVMs, you could get away with that because of all the squishing of the dimensions to zero
  • 28. Reference: Stanford University HumanitiesScience StatLearning: https://lagunita.stanford.edu/c4x/HumanitiesSciences/StatLearning/as set/svm-handout.pdf