SlideShare a Scribd company logo
Support Vector Machine
Classification , Regression and Outliers detection
Khan
Introduction
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.
Tuning
Parameters
SVM
1. Kernel
2. Regularization
3. Gamma
4. Margin
Margin
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.
Support Vector Machines ( SVM )
Regularization
● Also the ‘ C ‘ parameter in Python’s SkLearn Library
● Optimises SVM classifier to avoid misclassifying the
data.
● C → large Margin of hyperplane → small
● C → small Margin of hyperplane → large
● misclassification(possible)
1. C ---> large , chance of overfit
2. C ---> small , chance of underfitting
Support Vector Machines ( SVM )
Gamma
● Defines how far influences the calculation of of
plausible line of separation.
● Low gamma -----> points far from plausible line are
considered for calculation
● High gamma -----> points close to plausible line are
considered for calculation
High Gamma Value Low Gamma Value
Kernels
● Mathematical functions for transforming data
● using some linear algebra
● Different SVM algorithms use different types of
kernel functions
Various kernels available
1. Linear kernel
2. Non - linear kernel
3. Radial basis function ( RBF )
4. Sigmoid
5. Polynomial
6. Exponential
Example :
K(x, y) = <f(x), f(y)>
Kernel function dot product of n- dimensional inputs
Mathematical representation
x = (x1, x2, x3); y = (y1, y2, y3)
f(x) = (x1x1, x1x2, x1x3, x2x1, x2x2, x2x3, x3x1, x3x2, x3x3)
f(y) = (y1y1, y1y2, y1y3, y2y1, y2y2, y2y3, y3y1, y3y2, y3y3)
K(x, y ) = (<x, y>)²
x = (1, 2, 3)
y = (4, 5, 6)
f(x) = (1, 2, 3, 2, 4, 6, 3, 6, 9)
f(y) = (16, 20, 24, 20, 25, 30, 24, 30, 36)
<f(x), f(y)> = 16 + 40 + 72 + 40 + 100+ 180 + 72 + 180 + 324 = 1024
K(x, y ) = (4 + 10 + 18)² = 1024 ----> Kernel function
Pros :
● It works really well with clear margin of separation
● It is effective in high dimensional spaces.
● It is effective in cases where number of dimensions is greater
than the number of samples.
● It uses a subset of training points in the decision function
(called support vectors), so it is also memory efficient.
Cons :
● It doesn’t perform well, when we have large data set because
the required training time is higher
● It also doesn’t perform very well, when the data set has more
noise i.e. target classes are overlapping
● SVM doesn’t directly provide probability estimates, these are
calculated using an expensive five-fold cross-validation. It is
related SVC method of Python scikit-learn library.
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)
Let’s code now
Data used : Iris from Sklearn
Plots : Matplotlib
Kernels : Linear and rbf
File : svm_final.py
Link to code : Click here for code
Thank You
Ad

More Related Content

What's hot (20)

Decision Trees
Decision TreesDecision Trees
Decision Trees
Student
 
Perceptron (neural network)
Perceptron (neural network)Perceptron (neural network)
Perceptron (neural network)
EdutechLearners
 
Naive bayes
Naive bayesNaive bayes
Naive bayes
Ashraf Uddin
 
Decision tree
Decision treeDecision tree
Decision tree
R A Akerkar
 
Supervised and unsupervised learning
Supervised and unsupervised learningSupervised and unsupervised learning
Supervised and unsupervised learning
Paras Kohli
 
supervised learning
supervised learningsupervised learning
supervised learning
Amar Tripathi
 
backpropagation in neural networks
backpropagation in neural networksbackpropagation in neural networks
backpropagation in neural networks
Akash Goel
 
Artificial Neural Networks - ANN
Artificial Neural Networks - ANNArtificial Neural Networks - ANN
Artificial Neural Networks - ANN
Mohamed Talaat
 
Support Vector Machines
Support Vector MachinesSupport Vector Machines
Support Vector Machines
nextlib
 
Decision trees in Machine Learning
Decision trees in Machine Learning Decision trees in Machine Learning
Decision trees in Machine Learning
Mohammad Junaid Khan
 
Dbscan algorithom
Dbscan algorithomDbscan algorithom
Dbscan algorithom
Mahbubur Rahman Shimul
 
Ensemble learning
Ensemble learningEnsemble learning
Ensemble learning
Haris Jamil
 
Feature Engineering in Machine Learning
Feature Engineering in Machine LearningFeature Engineering in Machine Learning
Feature Engineering in Machine Learning
Knoldus Inc.
 
Performance Metrics for Machine Learning Algorithms
Performance Metrics for Machine Learning AlgorithmsPerformance Metrics for Machine Learning Algorithms
Performance Metrics for Machine Learning Algorithms
Kush Kulshrestha
 
Back propagation
Back propagationBack propagation
Back propagation
Nagarajan
 
Bias and variance trade off
Bias and variance trade offBias and variance trade off
Bias and variance trade off
VARUN KUMAR
 
PAC Learning
PAC LearningPAC Learning
PAC Learning
Sanghyuk Chun
 
Fuzzy Clustering(C-means, K-means)
Fuzzy Clustering(C-means, K-means)Fuzzy Clustering(C-means, K-means)
Fuzzy Clustering(C-means, K-means)
UMBC
 
MACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHMMACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHM
Puneet Kulyana
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessing
ankur bhalla
 
Decision Trees
Decision TreesDecision Trees
Decision Trees
Student
 
Perceptron (neural network)
Perceptron (neural network)Perceptron (neural network)
Perceptron (neural network)
EdutechLearners
 
Supervised and unsupervised learning
Supervised and unsupervised learningSupervised and unsupervised learning
Supervised and unsupervised learning
Paras Kohli
 
backpropagation in neural networks
backpropagation in neural networksbackpropagation in neural networks
backpropagation in neural networks
Akash Goel
 
Artificial Neural Networks - ANN
Artificial Neural Networks - ANNArtificial Neural Networks - ANN
Artificial Neural Networks - ANN
Mohamed Talaat
 
Support Vector Machines
Support Vector MachinesSupport Vector Machines
Support Vector Machines
nextlib
 
Decision trees in Machine Learning
Decision trees in Machine Learning Decision trees in Machine Learning
Decision trees in Machine Learning
Mohammad Junaid Khan
 
Ensemble learning
Ensemble learningEnsemble learning
Ensemble learning
Haris Jamil
 
Feature Engineering in Machine Learning
Feature Engineering in Machine LearningFeature Engineering in Machine Learning
Feature Engineering in Machine Learning
Knoldus Inc.
 
Performance Metrics for Machine Learning Algorithms
Performance Metrics for Machine Learning AlgorithmsPerformance Metrics for Machine Learning Algorithms
Performance Metrics for Machine Learning Algorithms
Kush Kulshrestha
 
Back propagation
Back propagationBack propagation
Back propagation
Nagarajan
 
Bias and variance trade off
Bias and variance trade offBias and variance trade off
Bias and variance trade off
VARUN KUMAR
 
Fuzzy Clustering(C-means, K-means)
Fuzzy Clustering(C-means, K-means)Fuzzy Clustering(C-means, K-means)
Fuzzy Clustering(C-means, K-means)
UMBC
 
MACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHMMACHINE LEARNING - GENETIC ALGORITHM
MACHINE LEARNING - GENETIC ALGORITHM
Puneet Kulyana
 
Data preprocessing
Data preprocessingData preprocessing
Data preprocessing
ankur bhalla
 

Similar to Support Vector Machines ( SVM ) (20)

svm-proyekt.pptx
svm-proyekt.pptxsvm-proyekt.pptx
svm-proyekt.pptx
ElinEliyev
 
Support vector machine learning.pptx
Support vector machine learning.pptxSupport vector machine learning.pptx
Support vector machine learning.pptx
Abhiroop Bhattacharya
 
Support Vector machine(SVM) and Random Forest
Support Vector machine(SVM) and Random ForestSupport Vector machine(SVM) and Random Forest
Support Vector machine(SVM) and Random Forest
umarcybermind
 
Machine Learning Notes for beginners ,Step by step
Machine Learning Notes for beginners ,Step by stepMachine Learning Notes for beginners ,Step by step
Machine Learning Notes for beginners ,Step by step
SanjanaSaxena17
 
SVM introduction for machine learning engineers
SVM introduction for machine learning engineersSVM introduction for machine learning engineers
SVM introduction for machine learning engineers
abigailjudith8
 
SVM[Support vector Machine] Machine learning
SVM[Support vector Machine] Machine learningSVM[Support vector Machine] Machine learning
SVM[Support vector Machine] Machine learning
aawezix
 
Sandy Ryza – Software Engineer, Cloudera at MLconf ATL
Sandy Ryza – Software Engineer, Cloudera at MLconf ATLSandy Ryza – Software Engineer, Cloudera at MLconf ATL
Sandy Ryza – Software Engineer, Cloudera at MLconf ATL
MLconf
 
Supervised and unsupervised learning
Supervised and unsupervised learningSupervised and unsupervised learning
Supervised and unsupervised learning
AmAn Singh
 
Anomaly detection using deep one class classifier
Anomaly detection using deep one class classifierAnomaly detection using deep one class classifier
Anomaly detection using deep one class classifier
홍배 김
 
Introduction to Support Vector Machines
Introduction to Support Vector MachinesIntroduction to Support Vector Machines
Introduction to Support Vector Machines
Silicon Mentor
 
05 contours seg_matching
05 contours seg_matching05 contours seg_matching
05 contours seg_matching
ankit_ppt
 
Machine Learning Algorithms (Part 1)
Machine Learning Algorithms (Part 1)Machine Learning Algorithms (Part 1)
Machine Learning Algorithms (Part 1)
Zihui Li
 
EE660_Report_YaxinLiu_8448347171
EE660_Report_YaxinLiu_8448347171EE660_Report_YaxinLiu_8448347171
EE660_Report_YaxinLiu_8448347171
Yaxin Liu
 
OM-DS-Fall2022-Session10-Support vector machine.pdf
OM-DS-Fall2022-Session10-Support vector machine.pdfOM-DS-Fall2022-Session10-Support vector machine.pdf
OM-DS-Fall2022-Session10-Support vector machine.pdf
ssuserb016ab
 
svm.pptx
svm.pptxsvm.pptx
svm.pptx
PriyadharshiniG41
 
Data clustering
Data clustering Data clustering
Data clustering
GARIMA SHAKYA
 
Efficient anomaly detection via matrix sketching
Efficient anomaly detection via matrix sketchingEfficient anomaly detection via matrix sketching
Efficient anomaly detection via matrix sketching
Hsing-chuan Hsieh
 
Module-3_SVM_Kernel_KNN.pptx
Module-3_SVM_Kernel_KNN.pptxModule-3_SVM_Kernel_KNN.pptx
Module-3_SVM_Kernel_KNN.pptx
VaishaliBagewadikar
 
SVM_notes.pdf
SVM_notes.pdfSVM_notes.pdf
SVM_notes.pdf
ShwetaGargade1
 
lec10svm.ppt
lec10svm.pptlec10svm.ppt
lec10svm.ppt
TheULTIMATEALLROUNDE
 
svm-proyekt.pptx
svm-proyekt.pptxsvm-proyekt.pptx
svm-proyekt.pptx
ElinEliyev
 
Support vector machine learning.pptx
Support vector machine learning.pptxSupport vector machine learning.pptx
Support vector machine learning.pptx
Abhiroop Bhattacharya
 
Support Vector machine(SVM) and Random Forest
Support Vector machine(SVM) and Random ForestSupport Vector machine(SVM) and Random Forest
Support Vector machine(SVM) and Random Forest
umarcybermind
 
Machine Learning Notes for beginners ,Step by step
Machine Learning Notes for beginners ,Step by stepMachine Learning Notes for beginners ,Step by step
Machine Learning Notes for beginners ,Step by step
SanjanaSaxena17
 
SVM introduction for machine learning engineers
SVM introduction for machine learning engineersSVM introduction for machine learning engineers
SVM introduction for machine learning engineers
abigailjudith8
 
SVM[Support vector Machine] Machine learning
SVM[Support vector Machine] Machine learningSVM[Support vector Machine] Machine learning
SVM[Support vector Machine] Machine learning
aawezix
 
Sandy Ryza – Software Engineer, Cloudera at MLconf ATL
Sandy Ryza – Software Engineer, Cloudera at MLconf ATLSandy Ryza – Software Engineer, Cloudera at MLconf ATL
Sandy Ryza – Software Engineer, Cloudera at MLconf ATL
MLconf
 
Supervised and unsupervised learning
Supervised and unsupervised learningSupervised and unsupervised learning
Supervised and unsupervised learning
AmAn Singh
 
Anomaly detection using deep one class classifier
Anomaly detection using deep one class classifierAnomaly detection using deep one class classifier
Anomaly detection using deep one class classifier
홍배 김
 
Introduction to Support Vector Machines
Introduction to Support Vector MachinesIntroduction to Support Vector Machines
Introduction to Support Vector Machines
Silicon Mentor
 
05 contours seg_matching
05 contours seg_matching05 contours seg_matching
05 contours seg_matching
ankit_ppt
 
Machine Learning Algorithms (Part 1)
Machine Learning Algorithms (Part 1)Machine Learning Algorithms (Part 1)
Machine Learning Algorithms (Part 1)
Zihui Li
 
EE660_Report_YaxinLiu_8448347171
EE660_Report_YaxinLiu_8448347171EE660_Report_YaxinLiu_8448347171
EE660_Report_YaxinLiu_8448347171
Yaxin Liu
 
OM-DS-Fall2022-Session10-Support vector machine.pdf
OM-DS-Fall2022-Session10-Support vector machine.pdfOM-DS-Fall2022-Session10-Support vector machine.pdf
OM-DS-Fall2022-Session10-Support vector machine.pdf
ssuserb016ab
 
Efficient anomaly detection via matrix sketching
Efficient anomaly detection via matrix sketchingEfficient anomaly detection via matrix sketching
Efficient anomaly detection via matrix sketching
Hsing-chuan Hsieh
 
Ad

More from Mohammad Junaid Khan (6)

K - Nearest neighbor ( KNN )
K - Nearest neighbor  ( KNN )K - Nearest neighbor  ( KNN )
K - Nearest neighbor ( KNN )
Mohammad Junaid Khan
 
Rise of PHP and Laravel. Latest Web Frameworks built on PHP.
Rise of PHP and Laravel. Latest Web Frameworks built on PHP.Rise of PHP and Laravel. Latest Web Frameworks built on PHP.
Rise of PHP and Laravel. Latest Web Frameworks built on PHP.
Mohammad Junaid Khan
 
Python
PythonPython
Python
Mohammad Junaid Khan
 
My SQL 1
My SQL 1My SQL 1
My SQL 1
Mohammad Junaid Khan
 
Ruby_Basic.pptx
Ruby_Basic.pptxRuby_Basic.pptx
Ruby_Basic.pptx
Mohammad Junaid Khan
 
Wireless transmission of power
Wireless transmission of powerWireless transmission of power
Wireless transmission of power
Mohammad Junaid Khan
 
Ad

Recently uploaded (20)

Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Adobe Illustrator Crack | Free Download & Install Illustrator
Adobe Illustrator Crack | Free Download & Install IllustratorAdobe Illustrator Crack | Free Download & Install Illustrator
Adobe Illustrator Crack | Free Download & Install Illustrator
usmanhidray
 
Agentic AI Use Cases using GenAI LLM models
Agentic AI Use Cases using GenAI LLM modelsAgentic AI Use Cases using GenAI LLM models
Agentic AI Use Cases using GenAI LLM models
Manish Chopra
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Mastering OOP: Understanding the Four Core Pillars
Mastering OOP: Understanding the Four Core PillarsMastering OOP: Understanding the Four Core Pillars
Mastering OOP: Understanding the Four Core Pillars
Marcel David
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
wareshashahzadiii
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Adobe Illustrator Crack | Free Download & Install Illustrator
Adobe Illustrator Crack | Free Download & Install IllustratorAdobe Illustrator Crack | Free Download & Install Illustrator
Adobe Illustrator Crack | Free Download & Install Illustrator
usmanhidray
 
Agentic AI Use Cases using GenAI LLM models
Agentic AI Use Cases using GenAI LLM modelsAgentic AI Use Cases using GenAI LLM models
Agentic AI Use Cases using GenAI LLM models
Manish Chopra
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Mastering OOP: Understanding the Four Core Pillars
Mastering OOP: Understanding the Four Core PillarsMastering OOP: Understanding the Four Core Pillars
Mastering OOP: Understanding the Four Core Pillars
Marcel David
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
Minitab 22 Full Crack Plus Product Key Free Download [Latest] 2025
wareshashahzadiii
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 

Support Vector Machines ( SVM )

  • 1. Support Vector Machine Classification , Regression and Outliers detection Khan
  • 2. Introduction 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.
  • 3. What could be drawn to classify the black dots from blue squares?
  • 4. A line drawn between these data points classify the black dots and blue squares. Linearly separable data
  • 5. Linear vs Nonlinear separable data
  • 6. What could be drawn to classify these data points ( red dots from blue stars )? NonLinearly separable data
  • 7. Here the hyperplane is a 2d plane drawn parallel to x-axis that is the separator. NonLinearly separable data
  • 8. Non Linear data ( type 2 ) Raw Data Line as Hyperplane
  • 9. 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
  • 10. 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.
  • 12. Margin 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.
  • 14. Regularization ● Also the ‘ C ‘ parameter in Python’s SkLearn Library ● Optimises SVM classifier to avoid misclassifying the data. ● C → large Margin of hyperplane → small ● C → small Margin of hyperplane → large ● misclassification(possible) 1. C ---> large , chance of overfit 2. C ---> small , chance of underfitting
  • 16. Gamma ● Defines how far influences the calculation of of plausible line of separation. ● Low gamma -----> points far from plausible line are considered for calculation ● High gamma -----> points close to plausible line are considered for calculation
  • 17. High Gamma Value Low Gamma Value
  • 18. Kernels ● Mathematical functions for transforming data ● using some linear algebra ● Different SVM algorithms use different types of kernel functions
  • 19. Various kernels available 1. Linear kernel 2. Non - linear kernel 3. Radial basis function ( RBF ) 4. Sigmoid 5. Polynomial 6. Exponential
  • 20. Example : K(x, y) = <f(x), f(y)> Kernel function dot product of n- dimensional inputs
  • 21. Mathematical representation x = (x1, x2, x3); y = (y1, y2, y3) f(x) = (x1x1, x1x2, x1x3, x2x1, x2x2, x2x3, x3x1, x3x2, x3x3) f(y) = (y1y1, y1y2, y1y3, y2y1, y2y2, y2y3, y3y1, y3y2, y3y3) K(x, y ) = (<x, y>)² x = (1, 2, 3) y = (4, 5, 6) f(x) = (1, 2, 3, 2, 4, 6, 3, 6, 9) f(y) = (16, 20, 24, 20, 25, 30, 24, 30, 36) <f(x), f(y)> = 16 + 40 + 72 + 40 + 100+ 180 + 72 + 180 + 324 = 1024 K(x, y ) = (4 + 10 + 18)² = 1024 ----> Kernel function
  • 22. Pros : ● It works really well with clear margin of separation ● It is effective in high dimensional spaces. ● It is effective in cases where number of dimensions is greater than the number of samples. ● It uses a subset of training points in the decision function (called support vectors), so it is also memory efficient.
  • 23. Cons : ● It doesn’t perform well, when we have large data set because the required training time is higher ● It also doesn’t perform very well, when the data set has more noise i.e. target classes are overlapping ● SVM doesn’t directly provide probability estimates, these are calculated using an expensive five-fold cross-validation. It is related SVC method of Python scikit-learn library.
  • 24. 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)
  • 25. Let’s code now Data used : Iris from Sklearn Plots : Matplotlib Kernels : Linear and rbf File : svm_final.py Link to code : Click here for code