SlideShare a Scribd company logo
1 of 26
Data Science
Classification Algorithms
Basics of SVM
Introduction to SVM
• Support Vector Machines (SVMs) are a type of supervised learning algorithm
that can be used for classification or regression tasks.
• The main idea behind SVMs is to find a hyperplane that maximally separates
the different classes in the training data.
• This is done by finding the hyperplane that has the largest margin, which is
defined as the distance between the hyperplane and the closest data points
from each class.
• SVMs are particularly useful when the data has many features, and/or when
there is a clear margin of separation in the data.
Support Vector Machine (SVM)
Machine
Learning
Technique
Supervised SVM
Classification
Linear
Regression
Applications of SVM
Face detection Gene classification Handwriting recognition
Object recognition
Data Type
 It does work on both linear and non-linear data types.
Non-linear separable
data
Linear separable data
Important Parameters in Kernelized
SVC ( Support Vector Classifier)
Kernel
1
Gamma
2
‘C’ parameter
3
Parameters of SVC (Cont…)
 Decide Margin
• Is the perpendicular distance
between the closest data points
and the hyperplane (on both sides)
• The best-optimized line with
maximum margin is termed as
margin maximal hyperplane
• The closest points where the
margin distance is calculated are
Parameters of SVC (Cont…)
 ‘C’ parameter
• This parameter controls the
amount of regularization applied to
the data.
• C > Margin of hyperplane -> small
• C< Margin of hyperplane-> large
• If C is too large chance of
overfitting (System doesn't learn
anything)
• If C is too small chance of
underlining
Parameters of SVC (Cont…)
 Gamma
• Defines how far influence the
calculation of reasonable line of
separation
• Gamma < Points fat from the
reasonable line are considered for
calculation
• Gamma > Points close to the
plausible line are considered for
calculation
Parameters of SVM (Cont…)
Kernel
Different SVM algorithm uses different types of linear algebraic kernel functions
• Linear Kernel
• Non-linear kernel
• Radial basis function
• Sigmoid
• Polynomial
• Exponential
Pros of SVM
They perform very well on a range of datasets.
They are versatile: different kernel functions can be
specified, or custom kernels can also be defined for
specific datatypes.
They work well for both high and low dimensional
data.
Cons of SVM
Efficiency (running time and memory usage) decreases as the size of the
training set increases.
Needs careful normalization of input data and parameter tuning.
Does not provide a direct probability estimator.
Difficult to interpret when a prediction was made.
Tools
• Matlab
• R tool
• Anaconda
Basics of Random Forest
(RM)
Introduction to RM
• Random forest is a supervised learning algorithm
• It has two variations – one is used for classification
problems and other is used for regression problems
• It creates decision trees on the given data samples
• Gets prediction from each tree and selects the best
solution by means of voting
• Random forest algorithm combines multiple decision-
trees, resulting in a forest of trees
• It is also a pretty good indicator of feature
importance
• In the random forest classifier, the higher the number
of trees in the forest results in higher accuracy
Diagram
Example
Applications of RM
Remote sensing
Multiclass object
detection
Object movement
detection
Advantages of RM
Reduce risk of
system overfitting,
Takes less training
time
It can predict
highly accurate
results on large
dataset
Also predict
missing data
points
Algorithm of RM
• Step 1: Select random samples from a given data or training set.
• Step 2: This algorithm will construct a decision tree for every
training data.
• Step 3: Voting will take place by averaging the decision tree.
• Step 4: Finally, select the most voted prediction result as the final
prediction result.
 This combination of multiple models is called Ensemble. The
ensemble uses two methods:
 Bagging: Creating a different training subset from sample training
data with replacement is called Bagging. The final output is based
on majority voting.
 Boosting: Combing weak learners into strong learners by
creating sequential models such that the final model has the
highest accuracy is called Boosting. Example: ADA BOOST, XG
BOOST.
Algorithm of RM (Cont…)
Parameters of RM
 There are more than 19 parameters of RM using
Sklearnlib
• n_estimators
• max_depth
• max_features
• Bootstrap
• max_samples
Bagging
The prediction at input x
when bootstrap sample
b is used for training
Bagging (Cont…)
Notice the bootstrap trees are different than the original tree
AND MUCH MORE…

More Related Content

Similar to Support Vector machine(SVM) and Random Forest

background.pptx
background.pptxbackground.pptx
background.pptxKabileshCm
 
Supervised and unsupervised learning
Supervised and unsupervised learningSupervised and unsupervised learning
Supervised and unsupervised learningAmAn Singh
 
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
 
sentiment analysis using support vector machine
sentiment analysis using support vector machinesentiment analysis using support vector machine
sentiment analysis using support vector machineShital Andhale
 
A Framework for Scene Recognition Using Convolutional Neural Network as Featu...
A Framework for Scene Recognition Using Convolutional Neural Network as Featu...A Framework for Scene Recognition Using Convolutional Neural Network as Featu...
A Framework for Scene Recognition Using Convolutional Neural Network as Featu...Tahmid Abtahi
 
How Machine Learning Helps Organizations to Work More Efficiently?
How Machine Learning Helps Organizations to Work More Efficiently?How Machine Learning Helps Organizations to Work More Efficiently?
How Machine Learning Helps Organizations to Work More Efficiently?Tuan Yang
 
Data Science - Part IX - Support Vector Machine
Data Science - Part IX -  Support Vector MachineData Science - Part IX -  Support Vector Machine
Data Science - Part IX - Support Vector MachineDerek Kane
 
Segmentation of Machine learning Algorithm
Segmentation of Machine learning AlgorithmSegmentation of Machine learning Algorithm
Segmentation of Machine learning AlgorithmBathshebaparimala
 
support vector machine 1.pptx
support vector machine 1.pptxsupport vector machine 1.pptx
support vector machine 1.pptxsurbhidutta4
 
04 Classification in Data Mining
04 Classification in Data Mining04 Classification in Data Mining
04 Classification in Data MiningValerii Klymchuk
 
Support Vector Machine Optimal Kernel Selection
Support Vector Machine Optimal Kernel SelectionSupport Vector Machine Optimal Kernel Selection
Support Vector Machine Optimal Kernel SelectionIRJET Journal
 
Classification-Support Vector Machines.pptx
Classification-Support Vector Machines.pptxClassification-Support Vector Machines.pptx
Classification-Support Vector Machines.pptxCiceer Ghimirey
 
Machine learning and linear regression programming
Machine learning and linear regression programmingMachine learning and linear regression programming
Machine learning and linear regression programmingSoumya Mukherjee
 

Similar to Support Vector machine(SVM) and Random Forest (20)

Rapid Miner
Rapid MinerRapid Miner
Rapid Miner
 
background.pptx
background.pptxbackground.pptx
background.pptx
 
Supervised and unsupervised learning
Supervised and unsupervised learningSupervised and unsupervised learning
Supervised and unsupervised learning
 
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
 
sentiment analysis using support vector machine
sentiment analysis using support vector machinesentiment analysis using support vector machine
sentiment analysis using support vector machine
 
random forest.pptx
random forest.pptxrandom forest.pptx
random forest.pptx
 
Module-3_SVM_Kernel_KNN.pptx
Module-3_SVM_Kernel_KNN.pptxModule-3_SVM_Kernel_KNN.pptx
Module-3_SVM_Kernel_KNN.pptx
 
svm.pptx
svm.pptxsvm.pptx
svm.pptx
 
A Framework for Scene Recognition Using Convolutional Neural Network as Featu...
A Framework for Scene Recognition Using Convolutional Neural Network as Featu...A Framework for Scene Recognition Using Convolutional Neural Network as Featu...
A Framework for Scene Recognition Using Convolutional Neural Network as Featu...
 
How Machine Learning Helps Organizations to Work More Efficiently?
How Machine Learning Helps Organizations to Work More Efficiently?How Machine Learning Helps Organizations to Work More Efficiently?
How Machine Learning Helps Organizations to Work More Efficiently?
 
Data Science - Part IX - Support Vector Machine
Data Science - Part IX -  Support Vector MachineData Science - Part IX -  Support Vector Machine
Data Science - Part IX - Support Vector Machine
 
Primer on major data mining algorithms
Primer on major data mining algorithmsPrimer on major data mining algorithms
Primer on major data mining algorithms
 
Moviereview prjct
Moviereview prjctMoviereview prjct
Moviereview prjct
 
SVM_notes.pdf
SVM_notes.pdfSVM_notes.pdf
SVM_notes.pdf
 
Segmentation of Machine learning Algorithm
Segmentation of Machine learning AlgorithmSegmentation of Machine learning Algorithm
Segmentation of Machine learning Algorithm
 
support vector machine 1.pptx
support vector machine 1.pptxsupport vector machine 1.pptx
support vector machine 1.pptx
 
04 Classification in Data Mining
04 Classification in Data Mining04 Classification in Data Mining
04 Classification in Data Mining
 
Support Vector Machine Optimal Kernel Selection
Support Vector Machine Optimal Kernel SelectionSupport Vector Machine Optimal Kernel Selection
Support Vector Machine Optimal Kernel Selection
 
Classification-Support Vector Machines.pptx
Classification-Support Vector Machines.pptxClassification-Support Vector Machines.pptx
Classification-Support Vector Machines.pptx
 
Machine learning and linear regression programming
Machine learning and linear regression programmingMachine learning and linear regression programming
Machine learning and linear regression programming
 

Recently uploaded

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxAnaBeatriceAblay2
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 

Recently uploaded (20)

9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 

Support Vector machine(SVM) and Random Forest

  • 3. Introduction to SVM • Support Vector Machines (SVMs) are a type of supervised learning algorithm that can be used for classification or regression tasks. • The main idea behind SVMs is to find a hyperplane that maximally separates the different classes in the training data. • This is done by finding the hyperplane that has the largest margin, which is defined as the distance between the hyperplane and the closest data points from each class. • SVMs are particularly useful when the data has many features, and/or when there is a clear margin of separation in the data.
  • 4. Support Vector Machine (SVM) Machine Learning Technique Supervised SVM Classification Linear Regression
  • 5. Applications of SVM Face detection Gene classification Handwriting recognition Object recognition
  • 6. Data Type  It does work on both linear and non-linear data types. Non-linear separable data Linear separable data
  • 7. Important Parameters in Kernelized SVC ( Support Vector Classifier) Kernel 1 Gamma 2 ‘C’ parameter 3
  • 8. Parameters of SVC (Cont…)  Decide Margin • Is the perpendicular distance between the closest data points and the hyperplane (on both sides) • The best-optimized line with maximum margin is termed as margin maximal hyperplane • The closest points where the margin distance is calculated are
  • 9. Parameters of SVC (Cont…)  ‘C’ parameter • This parameter controls the amount of regularization applied to the data. • C > Margin of hyperplane -> small • C< Margin of hyperplane-> large • If C is too large chance of overfitting (System doesn't learn anything) • If C is too small chance of underlining
  • 10. Parameters of SVC (Cont…)  Gamma • Defines how far influence the calculation of reasonable line of separation • Gamma < Points fat from the reasonable line are considered for calculation • Gamma > Points close to the plausible line are considered for calculation
  • 11. Parameters of SVM (Cont…) Kernel Different SVM algorithm uses different types of linear algebraic kernel functions • Linear Kernel • Non-linear kernel • Radial basis function • Sigmoid • Polynomial • Exponential
  • 12. Pros of SVM They perform very well on a range of datasets. They are versatile: different kernel functions can be specified, or custom kernels can also be defined for specific datatypes. They work well for both high and low dimensional data.
  • 13. Cons of SVM Efficiency (running time and memory usage) decreases as the size of the training set increases. Needs careful normalization of input data and parameter tuning. Does not provide a direct probability estimator. Difficult to interpret when a prediction was made.
  • 14. Tools • Matlab • R tool • Anaconda
  • 15. Basics of Random Forest (RM)
  • 16. Introduction to RM • Random forest is a supervised learning algorithm • It has two variations – one is used for classification problems and other is used for regression problems • It creates decision trees on the given data samples • Gets prediction from each tree and selects the best solution by means of voting • Random forest algorithm combines multiple decision- trees, resulting in a forest of trees • It is also a pretty good indicator of feature importance • In the random forest classifier, the higher the number of trees in the forest results in higher accuracy
  • 19. Applications of RM Remote sensing Multiclass object detection Object movement detection
  • 20. Advantages of RM Reduce risk of system overfitting, Takes less training time It can predict highly accurate results on large dataset Also predict missing data points
  • 21. Algorithm of RM • Step 1: Select random samples from a given data or training set. • Step 2: This algorithm will construct a decision tree for every training data. • Step 3: Voting will take place by averaging the decision tree. • Step 4: Finally, select the most voted prediction result as the final prediction result.  This combination of multiple models is called Ensemble. The ensemble uses two methods:  Bagging: Creating a different training subset from sample training data with replacement is called Bagging. The final output is based on majority voting.  Boosting: Combing weak learners into strong learners by creating sequential models such that the final model has the highest accuracy is called Boosting. Example: ADA BOOST, XG BOOST.
  • 22. Algorithm of RM (Cont…)
  • 23. Parameters of RM  There are more than 19 parameters of RM using Sklearnlib • n_estimators • max_depth • max_features • Bootstrap • max_samples
  • 24. Bagging The prediction at input x when bootstrap sample b is used for training
  • 25. Bagging (Cont…) Notice the bootstrap trees are different than the original tree