Support Vector Machine Algorithm

 Support Vector Machine Algorithm



Support vector machine or SVM algorithm is one of the most popular supervised learning algorithms.

It is not used for classification problems but also regression problems.


What does SVM do?

SVM separates the distances between boundaries of data, into truly separate classes (via wider margin and reducing errors).

SVM makes a lot of hyperplanes unless and until data do not get separated into classes 

So, in short, SVM creates the best hyperplane that can be non-linear.

SVM chooses vectors that help in creating the hyperplane. These extreme cases are called support vectors and hence the algorithm termed as Support Vector Machine.




First of all define a margin,
It should be as wide as possible.

Why we define a margin?
for Separating classes.
Good for prediction.

and the hyperplane lays exactly in the middle of the margin.

Why we use SVM?

Suppose we have two classes. Cats and dogs. Suppose we see a strange cat but has some quality of dog. and we have to identify correctly whether there is a dog and cat, at that time, support vector machine algorithm is used.

If we are trained a model with lot of cats and dogs images. So that it can learn about cats and dogs features. and then we test it with the strange creature. So as support vector creates decision boundary between these two data(cats and dogs) and choose extreme cases(Support vectors). It will see the extreme cases and on the basis of support vectors it will classify as cat.

Hyperplane:

there can be multiple lines to separate the data. But we need to find best decision boundary that helps to classify the data into two classes. That decision boundary called as hyperplane. It can be anything a cube, lines and higher order separators that lay in the mean of that separates the classes.

Support Vectors:

The data points are closest to the hyperplane that called as support vectors.


How does SVM works?

Let's imagine we have two classes, red and blue. So we want a classifier that can say that either it is red or blue.
 


Now, we have to find the best fit line that separates classes into red and blue.




But how can we consider that it is the best fit line. So , for that we have to define a margin. It should be as wide as possible. The hyperplane lays exactly in the middle of the margin.







To know more about kernel trick in SVM?

Stay tuned to my next Blog

till then happy reading and do codingšŸ˜€

If you have any doubt I am very happy to help you, Feel free to contact me






Comments

Popular Posts