EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 360+ Courses All in One Bundle
  • Login

SVM Algorithm

Home » Data Science » Data Science Tutorials » Machine Learning Tutorial » SVM Algorithm

SVM Algorithm

What is SVM Algorithm?

SVM stands for Support Vector Machine. SVM is a supervised machine learning algorithm that is commonly used for classification and regression challenges. Common applications of the SVM algorithm are Intrusion Detection System, Handwriting Recognition, Protein Structure Prediction, Detecting Steganography in digital images, etc.

In the SVM algorithm, each point is represented as a data item within the n-dimensional space where the value of each feature is the value of a specific coordinate.

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

After plotting, classification has been performed by finding hype-plane which differentiates two classes. Refer below image to understand this concept.

support vector

Support Vector Machine algorithm is mainly used to solve classification problems. Support vectors are nothing but the coordinates of each data item. Support Vector Machine is a frontier that differentiates two classes using hyper-plane.

How does the SVM algorithm work?

In the above section, we have discussed the differentiation of two classes using hyper-plane. Now we are going to see how does this SVM algorithm actually Works.

Scenario 1: Identify the right hyper-plane

Here we have taken three hyper-planes i.e. A, B and C. Now we have to identify the right hyper-plane to classify star and circle.

Popular Course in this category
Machine Learning Training (17 Courses, 27+ Projects)17 Online Courses | 27 Hands-on Projects | 159+ Hours | Verifiable Certificate of Completion | Lifetime Access
4.7 (8,463 ratings)
Course Price

View Course

Related Courses
Deep Learning Training (15 Courses, 24+ Projects)Artificial Intelligence Training (3 Courses, 2 Project)

hyper plane

To identify the right hyper-plane we should know the thumb rule. Select hyper-plane which differentiates two classes. In the above-mentioned image, hyper-plane B differentiates two classes very well.

Scenario 2: Identify the right hyper-plane

Here we have taken three hyper-planes i.e A, B, and C. These three hyper-planes are already differentiating classes very well.

right hyper plane

In this scenario, to identify the right hyper-plane we increase the distance between the nearest data points. This distance is nothing but a margin. Refer below image.

right hyper plane 1

In the above-mentioned image, the margin of hyper-plane C is higher than the hyper-plane A and hyper-plane B. So in this scenario, C is the right hyperplane. If we choose the hyperplane with a minimum margin, it can lead to misclassification. Hence we chose hyperplane C with maximum margin because of robustness.

Scenario 3: Identify the right hyper-plane

Note: To identify the hyper-plane follow the same rules as mentioned in the previous sections.

margin right hyper plane

As you can see in the above-mentioned image the margin of hyper-plane B is higher than the margin of hyper-plane A that’s why some will select hyper-plane B as a right. But in the SVM algorithm, it selects that hyper-plane which classify classes accurate prior to maximizing margin. In this scenario, hyper-plane A has classified all accurately and there is some error With the classification Of hyper-plane B. Therefore A is the right hyper-plane.

Scenario 4: Classify two classes

As you can see in the below-mentioned image, we are unable to differentiate two classes using a straight line because one star lies as an outlier in the other circle class.

class 1

Here, one star is in another class. For star class, this star is the outlier. Because of the robustness property of the SVM algorithm, it will find the right hyperplane with higher-margin ignoring an outlier.

class 2

Scenario 5: Fine hyper-plane to differentiate classes

Till now we have looked linear hyper-plane. In the below-mentioned image, we don’t have linear hyper-plane between classes.

SVM class

To classify these classes, SVM introduces some additional features. In this scenario, we are going to use this new feature z=x^2+y^2.

Plots all data points on the x and z-axis.

SVM class 1

Note

  • All the values on z-axis should be positive because z is equaled to the sum of x squared and y squared.
  • In the above-mentioned plot, red circles are closed to the origin of x-axis and y-axis, leading the value of z to lower and star is exactly the opposite of the circle, it is away from the origin of x-axis and y-axis, leading the value of z to high.

In the SVM algorithm, it is easy to classify using linear hyperplane between two classes. But the question arises here is should we add this feature of SVM to identify hyper-plane. So the answer is no, to solve this problem SVM has a technique that is commonly known as a kernel trick.

Kernel trick is the function that transforms data into a suitable form. There are various types of kernel functions used in the SVM algorithm i.e. Polynomial, linear, non-linear, Radial Basis Function, etc. Here using kernel trick low dimensional input space is converted into a higher-dimensional space.

When we look at the hyperplane the origin of the axis and y-axis, it looks like a circle. Refer below image.

SVM class 2

Pros of SVM Algorithm

  • Even if input data are non-linear and non-separable, SVMs generate accurate classification results because of its robustness.
  • In the decision function, it uses a subset of training points called support vectors hence it is memory efficient.
  • It is useful to solve any complex problem with a suitable kernel function.
  • In practice, SVM models are generalized, with less risk of overfitting in SVM.
  • SVMs works great for text classification and when finding the best linear separator.

Cons

  • It takes a long training time when working with large datasets.
  • It is hard to understand the final model and individual impact.

Conclusion

It has been guided to Support Vector Machine Algorithm which is a machine learning algorithm. In this article, we discussed what is the SVM algorithm, how it works and It’s advantages in detail.

Recommended Articles

This has been a guide to SVM Algorithm. Here we discuss its working with a scenario, pros, and cons of SVM Algorithm respectively. You may also look at the following articles to learn more –

  1. What is Machine Learning?
  2. Machine Learning Tools
  3. Examples of C++ Algorithm
  4. What is Digital Image?

Machine Learning Training (17 Courses, 27+ Projects)

17 Online Courses

27 Hands-on Projects

159+ Hours

Verifiable Certificate of Completion

Lifetime Access

Learn More

0 Shares
Share
Tweet
Share
Primary Sidebar
Machine Learning Tutorial
  • Algorithms
    • Machine Learning Algorithms
    • Types of Machine Learning Algorithms
    • Bayes Theorem
    • AdaBoost Algorithm
    • Classification Algorithms
    • Clustering Algorithm
    • Gradient Boosting Algorithm
    • Mean Shift Algorithm
    • Hierarchical Clustering Algorithm
    • What is a Greedy Algorithm?
    • What is Genetic Algorithm?
    • Random Forest Algorithm
    • Nearest Neighbors Algorithm
    • Weak Law of Large Numbers
    • Ray Tracing Algorithm
    • SVM Algorithm
    • Naive Bayes Algorithm
    • Neural Network Algorithms
    • Boosting Algorithm
    • XGBoost Algorithm
    • Pattern Searching
    • Loss Functions in Machine Learning
    • Decision Tree in Machine Learning
    • Hyperparameter Machine Learning
    • Unsupervised Machine Learning
    • K- Means Clustering Algorithm
    • KNN Algorithm
    • Monty Hall Problem
  • Basic
    • Introduction To Machine Learning
    • What is Machine Learning?
    • Uses of Machine Learning
    • Applications of Machine Learning
    • Careers in Machine Learning
    • What is Machine Cycle?
    • Machine Learning Feature
    • Machine Learning Programming Languages
    • Machine Learning Tools
    • Machine Learning Models
    • Machine Learning Platform
    • Machine Learning Libraries
    • Machine Learning Life Cycle
    • Machine Learning System
    • Machine Learning Datasets
    • Types of Machine Learning
    • Machine Learning Methods
    • Machine Learning Software
    • Machine Learning Techniques
    • Machine Learning Feature Selection
    • Ensemble Methods in Machine Learning
    • Decision Making Techniques
    • Restricted Boltzmann Machine
    • Regularization Machine Learning
    • What is Regression?
    • What is Linear Regression?
    • What is Decision Tree?
    • What is Random Forest
  • Supervised
    • What is Supervised Learning
    • Supervised Machine Learning
    • Supervised Machine Learning Algorithms
    • Perceptron Learning Algorithm
    • Simple Linear Regression
    • Polynomial Regression
    • Multivariate Regression
    • Regression in Machine Learning
    • Hierarchical Clustering Analysis
    • Linear Regression Analysis
    • Support Vector Regression
    • Linear Regression Modeling
    • Multiple Linear Regression
    • Linear Algebra in Machine Learning
    • Statistics for Machine Learning
    • What is Regression Analysis?
    • Linear Regression Analysis
    • Clustering Methods
    • Backward Elimination
    • Ensemble Techniques
    • Bagging and Boosting
    • Linear Regression Modeling
    • What is Reinforcement Learning
  • Classification
    • Kernel Methods in Machine Learning
    • Clustering in Machine Learning
    • Machine Learning Architecture
    • Machine Learning C++ Library
    • Machine Learning Frameworks
    • Data Preprocessing in Machine Learning
    • Data Science Machine Learning
    • Classification of Neural Network
    • Neural Network Machine Learning
    • What is Convolutional Neural Network?
    • Single Layer Neural Network
    • Kernel Methods
    • Forward and Backward Chaining
    • Forward Chaining
    • Backward Chaining
  • Deep Learning
    • What Is Deep learning
    • Deep Learning
    • Application of Deep Learning
    • Careers in Deep Learnings
    • Deep Learning Frameworks
    • Deep Learning Model
    • Deep Learning Algorithms
    • Deep Learning Technique
    • Deep Learning Networks
    • Deep Learning Libraries
    • Deep Learning Toolbox
    • Types of Neural Networks
    • Convolutional Neural Networks
    • Create Decision Tree
    • Deep Learning for NLP
    • Caffe Deep Learning
    • Deep Learning with TensorFlow
  • RPA
    • What is RPA
    • What is Robotics?
    • Benefits of RPA
    • RPA Applications
    • Types of Robots
    • RPA Tools
    • Line Follower Robot
    • What is Blue Prism?
    • RPA vs BPM
  • Pytorch
    • PyTorch Versions
    • Single Layer Perceptron
    • PyTorch vs Keras
    • torch.nn Module
  • UiPath
    • What is UiPath
    • UiPath Careers
    • UiPath Architecture
    • UiPath Orchestrator
    • Uipath Reframework
    • UiPath Studio
  • Interview Questions
    • Machine Learning Interview Questions
    • Deep Learning Interview Questions And Answer
    • Machine Learning Cheat Sheet

Related Courses

Machine Learning Training

Deep Learning Training

Artificial Intelligence Training

Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Database Management
  • Machine Learning
  • All Tutorials
Certification Courses
  • All Courses
  • Data Science Course - All in One Bundle
  • Machine Learning Course
  • Hadoop Certification Training
  • Cloud Computing Training Course
  • R Programming Course
  • AWS Training Course
  • SAS Training Course

© 2020 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

*Please provide your correct email id. Login details for this Free course will be emailed to you
Book Your One Instructor : One Learner Free Class

Let’s Get Started

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA Login

Forgot Password?

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

Special Offer - Machine Learning Training (17 Courses, 27+ Projects) Learn More