Support Vector Machines Algorithm

What is support vector machine algorithm?

Support vector machine algorithms are  widely used algorithms and mostly used for regression and for classification, which is statistical theory. so, The main objective of SVM is to segregate the data in the best possible way. thus For that, we categorize the data.

It also used to recognize the pattern between noisy and computed datasets. Support vector machines are abbreviated as SVM.

How does it work?

The main aim of this algorithm is to draw the best boundary that could classify data into two different categories that boundary could be also in use in the future for new data to make decisions.

Following are the important concept in SVM

  • Support vectors: Data points that are near the hyperplane above and also below the hyperplane are refer as support vectors.
  • Hyperplane: As shown in the above diagram hyperplan is space in which it however divides the data into two different classes.
  • Margin: It is the perpendicular distance from the support vector refer as margin.

TYPES  OF SUPPORT VECTOR:- 

There are two types of the support vector machine vector

  1. Simple SVM: It is used for simple  problems on linear dataset for classification and regression.
  2. Kernel SVM: It is in use for many complex problems and more number of non linear datasets more useful while recognizing the features of data which is less in the quantity.

How to implement the SVM 

To  show how it works we will go through some training process in data for we will use python scikit.learn library.

Following are process for implementations

  1. import the dataset
  2. Explore the data to find out what it looks like
  3. Pre-process the data
  4. Split the data into attributes and labels
  5. Classification of data into training and testing sets
  6. Train the SVM algorithm
  7. Make some predictions
  8. Evaluate the results of the algorithm

For practice  we are applying the support vector machine algorithms on Amazon food review dataset to detect text.

Figure-A

Here we have imported all the necessary libraries  which are require for svm after applying the preprocessing and  featurization technique.

Figure-B

In the above code we have applied the linear svm algorithm we got the output.

Figure-C

In the figure, we applied a prediction analysis of algorithms to estimate accuracy. In the output we got 0 .77 is the accuracy of the algorithm So Mainly SVM is applied to the numerical data. If our dataset is in the form of text data we first convert it into the vector format to apply this SVM algorithm.

Output figure-c is 0.77

Pros and Cons of SVM Classifiers

  • Pros of SVM

 Svm has great computational speed as it takes very less memory to load the  program in multidimensional space. thus, It uses a subset of training dataset for the classification. When we work with small datasets that have tens and hundreds of thousands of features . It  is more efficient compared to others.

  • Cons of  SVM

 It takes a lot of time on a training dataset hence it is not considered as good practice for work.

Application of  support vector machine in machine learning

  1. In economics  : SVM is used in management and finance  sector applications to recognize fraud,  Bankruptcy prediction etc.
  1. Application in sentiment Analysis: To categorize text  into different classes.

Conclusion:

Support vector machine algorithms are widely used by many researchers and programmers. It is the most useful classification problem such as text categorization, Speech recognition, etc.

Final words:

Here you might  be wondering if we have focused more on algorithms not on the maths behind because we don’t want to scare more by explaining all the mathematical equations. It is rarely used in projects. however, Our main  focus is on working on algorithms; therefore, they are inbuilt libraries in python  which will be used. 

References :-

https://www.sciencedirect.com/topics/biochemistry-genetics-and-molecular-biology/machine-learning

Written By: Triveni Kohale

Reviewed By: Vikas Bhardwaj

If you are Interested In Machine Learning You Can Check Machine Learning Internship Program
Also Check Other Technical And Non Technical Internship Programs

Leave a Comment

Your email address will not be published. Required fields are marked *