Hey everyone, my name is Asta Chohan, welcome to the Tutorials Point
In the previous video, we have learned all about the linear regression
And in this video, we are going to talk about support vector machine
So let's see what's in for you in this video. We are to look at why support vector machine? What is support vector machine
What are the technical terms of support vector machines? We are going to understand SVM, what are the advantages of SVM, and what are the applications of support vector machine
Now let's see why support vector machine. Let's say we have to determine whether the given ball is basketball or football
So let's build a model and train that on past label data
And this data is telling the model that this kind of ball is basketball and this kind of ball is football
So after the training, when we provide some new data to the model, it will predict that it's a basketball
Now, the question arises how does the prediction work? In this case, we are using support vector machine
So for understanding this, we have to understand what is support vector machine
From definition, support vector machine is a powerful and versatile supervised algorithm
that looks at the data and shorts it into one of the two categories Let understand this in detail with an example Let say we have two categories blue and green And we have plotted these data points on a graph
Now we have to separate them using a line. So how can we separate these two categories
We can separate these categories by drawing either of these two lines, red or green
Now the question arises which line should we choose? In this case, we choose the green line
Why is that? Before diving into that, let's understand some technical terms of the support vector machine
First is hyperplane. Hyperplane is the decision boundary that is used to separate the two categories
Next is support vectors. Support vectors are the closest data points to the hyperplane which makes a critical role in deciding the hyperplane and the margin
Next very important term is margin. So margin is the distance between the support vector and the hyperplane
The main objective of the support vector machine is to maximize the margin
The wider margin indicates the better classification performance. Now let's move to why we have chosen that green line as our hyperplane
We have hyperplane, we have support vectors. And the distance between the support vector and the hyperplane is called margin
For having the optimal hyperplane we need the maximum margin distance So let say this margin is our positive margin D plus and this is our negative margin that is D minus
So we must have the maximum margin. That means the sum of D plus and D minus is maximum
So we can say that the hyperplane for which the margin is maximum is called the optimal hyperplane
And that hyperplane gives us the best results. results. Now we had this kind of data set. So we use the hyperplane to segregate them
But what if the data was not like this. Instead it was like this. In this one kind of
category falls under the another. And in this case we can't use the hyperplane to separate
the two categories. So what we are going to do? So for this kind of data set we transform our
1d plot to the 2d plot and for the transformation what we use is called kernel function. We had data
set we had 1D plot and we are not able to use the hyperplane in this
So we transformed that using kernel function into the 2D plot and now we can use the hyperplane
to separate the two categories. Now how we are going to separate this kind of data set
We already have 2D plot and one category lies between the another category
Again, hyperplane does not work for this kind of data set. We can separate this using the hyperplane So what we are going to do Again we are going to transform this 2D plot using kernel into the 3D plot And here from this 3D plot we can observe that we are able to separate two categories using the hyperplane
Now let's discuss the advantages of support vector machine. First is high dimensional input space. Many problems start taking when we work in high dimensional input space in other algorithms and we need to adjust them. But as
SVM does that automatically in high dimensional space. One of the high dimensional spaces is called sparse document vectors
This is where we tokenize the words and the documents. Regularization parameter helps us in determining whether we are going to have the bias or overfitting
that we have to manage in many other algorithms but SVM naturally does that for us
Now here are some applications mentioned of the support vector machine. machine, such is face detection, text and hypertext categorization, classification of images
and bioinformatics. So that was it for this video. We have already discussed the supervised machine learning algorithm, canon algorithm, decision
tree, linear regression, support vector machine in this video. And we are going to discuss random forests in the next video and rest all the machine learning
algorithms in further videos. So stay tuned with Tutorials point. Have a nice day and thanks for watching