SlideShare a Scribd company logo
1 of 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?

More Related Content

Similar to 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
 
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
 
Predict Backorder on a supply chain data for an Organization
Predict Backorder on a supply chain data for an OrganizationPredict Backorder on a supply chain data for an Organization
Predict Backorder on a supply chain data for an OrganizationPiyush Srivastava
 

Similar to 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
 
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)
 
Predict Backorder on a supply chain data for an Organization
Predict Backorder on a supply chain data for an OrganizationPredict Backorder on a supply chain data for an Organization
Predict Backorder on a supply chain data for an Organization
 

More from 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
 

More from 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
 

Recently uploaded

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Recently uploaded (20)

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

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: