SlideShare une entreprise Scribd logo
1  sur  28
Support Vector Machine (SVM)
Machine Learning
Introduction:
● Support Vector Machine is a supervised machine learning problem where to try to
find a hyperplane that best separates two classes.
● It is considered as one of the best algorithm as it can handle high-dimensional data,
is effective in cases with limited training samples, and can handle nonlinear
classification using kernel functions.
● SVM can be used for both regression and classification tasks, but generally work best
in classification problem.
What is SVM ?
Types of SVM Algorithm:
1. Simple or Linear SVM: When the data is perfectly linearly separable only then we
can use Linear SVM. Perfectly linearly separable means that the data points can be
classified into 2 classes by using a single straight line(if 2D).
1. Kernel or Non-Linear SVM: When the data is not linearly separable then we can
use Non-Linear SVM, which means when the data points cannot be separated into
2 classes by using a straight line (if 2D) then we use some advanced techniques
like kernel tricks to classify them. In most real-world applications we do not find
linearly separable data points hence we use kernel trick to solve them.
Important Terms:
1. Support Vectors: These are the points that
are closest to the hyperplane. A separating
line will be defined with the help of these data
points.
1. Margin: it is the distance between the
hyperplane and the observations closest to
the hyperplane (support vectors). There are
two types of margins hard margin and soft
margin.
1. Hyperplane: The best-line or decision
boundary that can segregate N-dimensional
space into classes so that we can easily put
the new data point in the correct category.
Hyper Plane:
Hyperplanes are decision boundaries that help classify the data points. Data points
falling on either side of the hyperplane can be attributed to different classes.
dimension of the hyperplane = the number of features
If, number of input features is 2, hyperplane is just a line.
number of input features is 3, hyperplane becomes a two-dimensional plane.
Objective:
Objective of the SVM algorithm
is to find a hyperplane that, to
the best degree possible,
separates data points of one
class from those of another
class.
How does SVM work ?
Suppose we have a dataset that has two classes (green and blue). We
want to classify that the new data point as either blue or green.
How does SVM work ?
Best Hyperplane = Finding
different hyperplanes which
classify the labels in the best
way then it will choose the
one which is farthest from the
data points or the one which
has a maximum margin.
Hard Margin SVM (Dot Product):
● Consider a random point X and we
want to know whether it lies on
the right side of the plane or the
left side of the plane (positive or
negative).
● First we assume this point is a
vector (X) and then we make a
vector (w) which is perpendicular
to the hyperplane.
Decision Rule:
We all know the equation of a
hyperplane is w.x+b=0 where w is
a vector normal to hyperplane and
b is an offset.
Soft margin SVM:
● In real-life applications, we rarely
encounter datasets that are perfectly
linearly separable. Instead, we often
come across datasets that are either
nearly linearly separable or entirely
non-linearly separable.
● To tackle this problem what we do is
modify that equation in such a way that
it allows few misclassifications that
means it allows few points to be
wrongly classified.
Kernel in SVM:
● Kernels = functions that helps to convert lower dimension space to a higher
dimension space using some quadratic functions.
Types of Kernel Functions:
● Polynomial Kernel = Separate data of Degree 2.
● RBF Kernel = (Most used) Lift our samples onto a higher-dimensional feature
● Bessel function Kernel: Used for eliminating the cross term in mathematical
functions
● Anova Kernel: Multidimensional regression problems
Right Kernel = What type of Dataset we are working on?
Linear Dataset = Linear Kernel Function
Complex Dataset = RBF Kernel Function
Import Necessary Libraries
Load Data from CSV file
Distribution of the Classes
Identification of the unwanted rows
Remove unwanted Columns
Divide data as Train/Test
Modeling
Model Output :
Evaluation of Results
● Accuracy: The portion of correctly classified instances among the
total instances.
● Precision and recall: Precision measures the portion of true
positive predictions among all positive predictions while recall
measures the portion of true positive predictions among all
actual positives.
● F1 Score: The harmonic mean of precision and recall, which
provides a balance between the two metrics.
● Support: Support refers to the number of occurrences of each
class in the actual data. It represents the number of samples
belonging to each class.
Metrics:
● SVM works better when the data is linear
● It is more effective in high dimensions
● With the help of the kernel trick, we can solve any complex problem
● SVM is not sensitive to outliers
● Can help us with Image Classification
Advantages of SVM
● Choosing a good kernel is not easy
● It does not show good result on a big dataset
● The SVM hyperparameters are Cost -C and gamma.
● It is not easy to fine-tune these hyper-parameters.
● It is hard to visualize their impact
Disadvantage of SVM
● We have demonstrated SVM by segregation two different classes.
● We discussed its concept of working, math intuition behind SVM,
implementation in python, the tricks to classify non-linear datasets, Pros and
cons, and finally, we solved a problem with the help of SVM.
Support vector machine is an elegant and powerful algorithm.
Conclusion:
THANK YOU!
Any Questions?

Contenu connexe

Similaire à Classification-Support Vector Machines.pptx

SVM & KNN Presentation.pptx
SVM & KNN Presentation.pptxSVM & KNN Presentation.pptx
SVM & KNN Presentation.pptxMohamedMonir33
 
Support Vector Machine ppt presentation
Support Vector Machine ppt presentationSupport Vector Machine ppt presentation
Support Vector Machine ppt presentationAyanaRukasar
 
Support Vector Machine topic of machine learning.pptx
Support Vector Machine topic of machine learning.pptxSupport Vector Machine topic of machine learning.pptx
Support Vector Machine topic of machine learning.pptxCodingChamp1
 
Introduction to Machine Learning Elective Course
Introduction to Machine Learning Elective CourseIntroduction to Machine Learning Elective Course
Introduction to Machine Learning Elective CourseMayuraD1
 
Support Vector Machines- SVM
Support Vector Machines- SVMSupport Vector Machines- SVM
Support Vector Machines- SVMCarlo Carandang
 
properties, application and issues of support vector machine
properties, application and issues of support vector machineproperties, application and issues of support vector machine
properties, application and issues of support vector machineDr. Radhey Shyam
 
Lec_XX_Support Vector Machine Algorithm.pptx
Lec_XX_Support Vector Machine Algorithm.pptxLec_XX_Support Vector Machine Algorithm.pptx
Lec_XX_Support Vector Machine Algorithm.pptxpiwig56192
 
svm-proyekt.pptx
svm-proyekt.pptxsvm-proyekt.pptx
svm-proyekt.pptxElinEliyev
 
Kate · SlidesCarnival.pptx
Kate · SlidesCarnival.pptxKate · SlidesCarnival.pptx
Kate · SlidesCarnival.pptxAhmedSalah48055
 
Supervised and unsupervised learning
Supervised and unsupervised learningSupervised and unsupervised learning
Supervised and unsupervised learningAmAn Singh
 
Support Vector Machine.pptx
Support Vector Machine.pptxSupport Vector Machine.pptx
Support Vector Machine.pptxHarishNayak44
 
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 Forestumarcybermind
 
Machine learning session8(svm nlp)
Machine learning   session8(svm nlp)Machine learning   session8(svm nlp)
Machine learning session8(svm nlp)Abhimanyu Dwivedi
 

Similaire à Classification-Support Vector Machines.pptx (20)

Support vector machines
Support vector machinesSupport vector machines
Support vector machines
 
SVM & KNN Presentation.pptx
SVM & KNN Presentation.pptxSVM & KNN Presentation.pptx
SVM & KNN Presentation.pptx
 
Support Vector Machine ppt presentation
Support Vector Machine ppt presentationSupport Vector Machine ppt presentation
Support Vector Machine ppt presentation
 
Support vector machines
Support vector machinesSupport vector machines
Support vector machines
 
Support Vector Machine topic of machine learning.pptx
Support Vector Machine topic of machine learning.pptxSupport Vector Machine topic of machine learning.pptx
Support Vector Machine topic of machine learning.pptx
 
Ai saturdays presentation
Ai saturdays presentationAi saturdays presentation
Ai saturdays presentation
 
Introduction to Machine Learning Elective Course
Introduction to Machine Learning Elective CourseIntroduction to Machine Learning Elective Course
Introduction to Machine Learning Elective Course
 
Support Vector Machines- SVM
Support Vector Machines- SVMSupport Vector Machines- SVM
Support Vector Machines- SVM
 
properties, application and issues of support vector machine
properties, application and issues of support vector machineproperties, application and issues of support vector machine
properties, application and issues of support vector machine
 
Lec_XX_Support Vector Machine Algorithm.pptx
Lec_XX_Support Vector Machine Algorithm.pptxLec_XX_Support Vector Machine Algorithm.pptx
Lec_XX_Support Vector Machine Algorithm.pptx
 
svm-proyekt.pptx
svm-proyekt.pptxsvm-proyekt.pptx
svm-proyekt.pptx
 
Kate · SlidesCarnival.pptx
Kate · SlidesCarnival.pptxKate · SlidesCarnival.pptx
Kate · SlidesCarnival.pptx
 
Support vector machine
Support vector machineSupport vector machine
Support vector machine
 
Supervised and unsupervised learning
Supervised and unsupervised learningSupervised and unsupervised learning
Supervised and unsupervised learning
 
Support Vector Machine.pptx
Support Vector Machine.pptxSupport Vector Machine.pptx
Support Vector Machine.pptx
 
SVM_notes.pdf
SVM_notes.pdfSVM_notes.pdf
SVM_notes.pdf
 
Support Vector Machines ( SVM )
Support Vector Machines ( SVM ) Support Vector Machines ( SVM )
Support Vector Machines ( SVM )
 
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
 
lec10svm.ppt
lec10svm.pptlec10svm.ppt
lec10svm.ppt
 
Machine learning session8(svm nlp)
Machine learning   session8(svm nlp)Machine learning   session8(svm nlp)
Machine learning session8(svm nlp)
 

Plus de Ciceer Ghimirey

Machine Vision Concepts ,Application & Components.pptx
Machine Vision Concepts ,Application & Components.pptxMachine Vision Concepts ,Application & Components.pptx
Machine Vision Concepts ,Application & Components.pptxCiceer Ghimirey
 
Lab 5 Linux File Structure and Hierarchy.pptx
Lab 5 Linux File Structure and Hierarchy.pptxLab 5 Linux File Structure and Hierarchy.pptx
Lab 5 Linux File Structure and Hierarchy.pptxCiceer Ghimirey
 
Lab 4 -Linux Files, Directories and Basic Commands Part-2.pptx
Lab 4 -Linux Files, Directories and Basic Commands Part-2.pptxLab 4 -Linux Files, Directories and Basic Commands Part-2.pptx
Lab 4 -Linux Files, Directories and Basic Commands Part-2.pptxCiceer Ghimirey
 
Lab 3 -Linux Files, Directories and Basic Commands.pptx
Lab 3 -Linux Files, Directories and Basic Commands.pptxLab 3 -Linux Files, Directories and Basic Commands.pptx
Lab 3 -Linux Files, Directories and Basic Commands.pptxCiceer Ghimirey
 
Install Linux OS in Virtual Box.pptx
Install Linux OS in Virtual Box.pptxInstall Linux OS in Virtual Box.pptx
Install Linux OS in Virtual Box.pptxCiceer Ghimirey
 
Install LAMP Stack in Linux Server OS and Hosting a Custom Domain .pptx
 Install LAMP Stack  in Linux Server OS and Hosting a Custom Domain .pptx Install LAMP Stack  in Linux Server OS and Hosting a Custom Domain .pptx
Install LAMP Stack in Linux Server OS and Hosting a Custom Domain .pptxCiceer Ghimirey
 
Complete WordPress Setup (Description about Themes & Plugins Added)
Complete WordPress Setup (Description about Themes & Plugins Added)Complete WordPress Setup (Description about Themes & Plugins Added)
Complete WordPress Setup (Description about Themes & Plugins Added)Ciceer Ghimirey
 
WordPress Introduction and WordPress Theme Installation Slides
WordPress Introduction and WordPress Theme Installation SlidesWordPress Introduction and WordPress Theme Installation Slides
WordPress Introduction and WordPress Theme Installation SlidesCiceer Ghimirey
 

Plus de Ciceer Ghimirey (8)

Machine Vision Concepts ,Application & Components.pptx
Machine Vision Concepts ,Application & Components.pptxMachine Vision Concepts ,Application & Components.pptx
Machine Vision Concepts ,Application & Components.pptx
 
Lab 5 Linux File Structure and Hierarchy.pptx
Lab 5 Linux File Structure and Hierarchy.pptxLab 5 Linux File Structure and Hierarchy.pptx
Lab 5 Linux File Structure and Hierarchy.pptx
 
Lab 4 -Linux Files, Directories and Basic Commands Part-2.pptx
Lab 4 -Linux Files, Directories and Basic Commands Part-2.pptxLab 4 -Linux Files, Directories and Basic Commands Part-2.pptx
Lab 4 -Linux Files, Directories and Basic Commands Part-2.pptx
 
Lab 3 -Linux Files, Directories and Basic Commands.pptx
Lab 3 -Linux Files, Directories and Basic Commands.pptxLab 3 -Linux Files, Directories and Basic Commands.pptx
Lab 3 -Linux Files, Directories and Basic Commands.pptx
 
Install Linux OS in Virtual Box.pptx
Install Linux OS in Virtual Box.pptxInstall Linux OS in Virtual Box.pptx
Install Linux OS in Virtual Box.pptx
 
Install LAMP Stack in Linux Server OS and Hosting a Custom Domain .pptx
 Install LAMP Stack  in Linux Server OS and Hosting a Custom Domain .pptx Install LAMP Stack  in Linux Server OS and Hosting a Custom Domain .pptx
Install LAMP Stack in Linux Server OS and Hosting a Custom Domain .pptx
 
Complete WordPress Setup (Description about Themes & Plugins Added)
Complete WordPress Setup (Description about Themes & Plugins Added)Complete WordPress Setup (Description about Themes & Plugins Added)
Complete WordPress Setup (Description about Themes & Plugins Added)
 
WordPress Introduction and WordPress Theme Installation Slides
WordPress Introduction and WordPress Theme Installation SlidesWordPress Introduction and WordPress Theme Installation Slides
WordPress Introduction and WordPress Theme Installation Slides
 

Dernier

Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfFIDO Alliance
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGDSC PJATK
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!Memoori
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctBrainSell Technologies
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxFIDO Alliance
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentationyogeshlabana357357
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024Lorenzo Miniero
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxFIDO Alliance
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...ScyllaDB
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data SciencePaolo Missier
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfalexjohnson7307
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxjbellis
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...panagenda
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...FIDO Alliance
 

Dernier (20)

Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 

Classification-Support Vector Machines.pptx

  • 3. Introduction: ● Support Vector Machine is a supervised machine learning problem where to try to find a hyperplane that best separates two classes. ● It is considered as one of the best algorithm as it can handle high-dimensional data, is effective in cases with limited training samples, and can handle nonlinear classification using kernel functions. ● SVM can be used for both regression and classification tasks, but generally work best in classification problem. What is SVM ?
  • 4. Types of SVM Algorithm: 1. Simple or Linear SVM: When the data is perfectly linearly separable only then we can use Linear SVM. Perfectly linearly separable means that the data points can be classified into 2 classes by using a single straight line(if 2D). 1. Kernel or Non-Linear SVM: When the data is not linearly separable then we can use Non-Linear SVM, which means when the data points cannot be separated into 2 classes by using a straight line (if 2D) then we use some advanced techniques like kernel tricks to classify them. In most real-world applications we do not find linearly separable data points hence we use kernel trick to solve them.
  • 5. Important Terms: 1. Support Vectors: These are the points that are closest to the hyperplane. A separating line will be defined with the help of these data points. 1. Margin: it is the distance between the hyperplane and the observations closest to the hyperplane (support vectors). There are two types of margins hard margin and soft margin. 1. Hyperplane: The best-line or decision boundary that can segregate N-dimensional space into classes so that we can easily put the new data point in the correct category.
  • 6. Hyper Plane: Hyperplanes are decision boundaries that help classify the data points. Data points falling on either side of the hyperplane can be attributed to different classes. dimension of the hyperplane = the number of features If, number of input features is 2, hyperplane is just a line. number of input features is 3, hyperplane becomes a two-dimensional plane.
  • 7. Objective: Objective of the SVM algorithm is to find a hyperplane that, to the best degree possible, separates data points of one class from those of another class.
  • 8. How does SVM work ? Suppose we have a dataset that has two classes (green and blue). We want to classify that the new data point as either blue or green.
  • 9. How does SVM work ? Best Hyperplane = Finding different hyperplanes which classify the labels in the best way then it will choose the one which is farthest from the data points or the one which has a maximum margin.
  • 10. Hard Margin SVM (Dot Product): ● Consider a random point X and we want to know whether it lies on the right side of the plane or the left side of the plane (positive or negative). ● First we assume this point is a vector (X) and then we make a vector (w) which is perpendicular to the hyperplane.
  • 11. Decision Rule: We all know the equation of a hyperplane is w.x+b=0 where w is a vector normal to hyperplane and b is an offset.
  • 12. Soft margin SVM: ● In real-life applications, we rarely encounter datasets that are perfectly linearly separable. Instead, we often come across datasets that are either nearly linearly separable or entirely non-linearly separable. ● To tackle this problem what we do is modify that equation in such a way that it allows few misclassifications that means it allows few points to be wrongly classified.
  • 13. Kernel in SVM: ● Kernels = functions that helps to convert lower dimension space to a higher dimension space using some quadratic functions.
  • 14. Types of Kernel Functions: ● Polynomial Kernel = Separate data of Degree 2. ● RBF Kernel = (Most used) Lift our samples onto a higher-dimensional feature ● Bessel function Kernel: Used for eliminating the cross term in mathematical functions ● Anova Kernel: Multidimensional regression problems Right Kernel = What type of Dataset we are working on? Linear Dataset = Linear Kernel Function Complex Dataset = RBF Kernel Function
  • 16. Load Data from CSV file
  • 18. Identification of the unwanted rows
  • 20. Divide data as Train/Test
  • 24. ● Accuracy: The portion of correctly classified instances among the total instances. ● Precision and recall: Precision measures the portion of true positive predictions among all positive predictions while recall measures the portion of true positive predictions among all actual positives. ● F1 Score: The harmonic mean of precision and recall, which provides a balance between the two metrics. ● Support: Support refers to the number of occurrences of each class in the actual data. It represents the number of samples belonging to each class. Metrics:
  • 25. ● SVM works better when the data is linear ● It is more effective in high dimensions ● With the help of the kernel trick, we can solve any complex problem ● SVM is not sensitive to outliers ● Can help us with Image Classification Advantages of SVM
  • 26. ● Choosing a good kernel is not easy ● It does not show good result on a big dataset ● The SVM hyperparameters are Cost -C and gamma. ● It is not easy to fine-tune these hyper-parameters. ● It is hard to visualize their impact Disadvantage of SVM
  • 27. ● We have demonstrated SVM by segregation two different classes. ● We discussed its concept of working, math intuition behind SVM, implementation in python, the tricks to classify non-linear datasets, Pros and cons, and finally, we solved a problem with the help of SVM. Support vector machine is an elegant and powerful algorithm. Conclusion: