Skip to main content

SUPPORT VECTOR MACHINE

                 SUPPORT VECTOR MACHINE:-

Support vector machine:-it is a type of supervised learning algorithm it is used to solve both classification and regression problem.

Note:- It is mostly used for classification problems.

what we are going to learn in SVM:

a) Support vectors

b) Hyperplane

c) Marginal Distance

d) Linear Separable

e) Non-linear separable

f) support kernels


NOw we will discuss everything in detail.


Hyper plane:-


in the above diagram, we have drawn three lines(A, B, C) separating two data points(stars and reds) The lines (A, B, C) are called Hyperplanes.

Note:-“Select the hyper-plane which segregates the two classes better”

i.e above there are three hyperplanes how to select the best hyperplane?

b)Marginal Distance:-

When we draw a hyperplane the plane creates two new(------) dotted lines one line above the hyperplane and one line below the hyperplane line. see the below image you will get an idea


Suppose line is my hyperplane and B and A are my marginal lines.
 Now, what is marginal distance:

 we have to measure The maximum distance between the stars and red, The distance is called Marginal distance
Note:-The distance is should always Maximum.

 Support vectors:
what are support vectors 

support vectors are nothing but the nearest data point to the marginal line is called a support vector.
if see the above image there is a small line from the Star symbol to the line that the data point is called the support vector.  

Note:-The hyperplane is should have a maximum marginal distance near to the data points.


Linear Separable:
linear separable means how the marginal line separating the data points

see below image
how the line is linearly separating the data points this is called linear separable. 




 If you see the below image there is a star in red that data point is called an outlier.
SVM is robust to outliers.
if you are working with SVM to treat outliers.



 Non-linear separable:
I tried to draw the best diagram adjust😂😁
Non-linear separable means see the below image there are red stars and black stars and we create a hyperplane it is separating the data points.
Question: How to solve this issue?
Answer:-when we draw a hyperplane between data points it won't separate data points cleary,
So what will happen means some of the data points are on one side and some of the data are on another side so it will affect the accuracy.
How to solve the above problem.


if you see the above image we have created a small hyperplane
 with the help of support kernels, we are able to do that,
it converts our low dimension data into the high dimension.  


Support kernel:
Support kernel is nothing but converting low dimension data into the high dimension to separate the data points this is called a SUPPORT KERNEL.


for code, part check my GitHub.

Comments

Popular posts from this blog

Loss Functions | MSE | MAE | RMSE

            Performance Metrics The various metrics used to evaluate the results of the prediction are : Mean Squared Error(MSE) Mean Absolute error(MAE) Root-Mean-Squared-Error(RMSE) Adjusted R² Mean Squared Error: Mean Squared error is one of the most used metrics for regression tasks. MSE is simply the average of the squared difference between the target value and value predicted by the regression model.  As it squares the differences and  penalizes (punish)even a small error which leads to over-estimation of how bad the model is. It is preferred more than other metrics because it is differentiable and hence can be optimized better. in the above formulae, y=actual value and ( yhat) means predicted value by the model. RMSE(Root Mean Squared Error: This is the same as MSE (Mean Squared Error) but the root of the value is considered while determining the accuracy of the model. It is preferred more in some cases because the errors are first...

LSTM

                                                                                  LSTM  we will discuss now each and every stage with the help of the above diagram. State1:Memory View The memory view is responsible for remembering and forget the information based on the context of an input. (you didn't get it, wait now you will understand). In the above diagram, the memory view is the top line.   key points( Ct-1, X, +,  and Ct) . The input is an old memory, X is multiplication which forgets the useless information from the old memory, and " +"   addition lets merge all these things. when we multiply the old memory with '0' the old memory will "0" or if we multiply with vector "1" The old memory won't change. ( what ...

KNN Interview Questions

                           KNN interview questions 1) Which of the following distance metric can not be used in k-NN? A) Euclidean Distance B) Manhatten Distance c) Hamming Distance E) Minkowski Distance F) Jaccard Distance G) All the above Answer:- G All of these distance metric can be used as a distance metric for KNN 2)Knn is for regression or classification? Answer:- Knn is used for both classification and regression problems. 3) When we use Manhatten Distance? Answer:-Manhatten distance is used for continuous variables. 4) You have given the following 2 statements, find which of these options is/are true in case of k-NN? In the case of very large value of k , we may include points from other classes into the neighborhood, so it leads to overfitting. In case of too small value of k the algorithm is very sensitive to noise.(it will affect our model performance). Answer:-The above two points are answers. 5...