Support Vector Machine(SVM):I can do both classification and regression.

Harsh Tiwari
Analytics Vidhya
Published in
3 min readMay 22, 2021

--

You want to know what my real strengths are and also how I work so efficiently says SVM .

Before getting started to how I work. I want you to get acquainted with few terms and terminologies which will definitely help you in understanding me better. let’s get started….

  1. Hyperplane: When a line passes from higher than 2D plane ,it is called Hyperplane.
  2. Marginal plane : Two plane parallel to the original hyperplane ,they are called marginal plane.
  3. Support Vectors: Vectors or data points which passes through the marginal line are called support vectors.
  4. Marginal Distance: Distance between both marginal plane which lie on both side of hyperplane is called Marginal distance.
Support Vector Machine

SVM is a very simple but yet very powerful supervised machine learning algorithm. I basically finds a plane which distinguishes two classes(positive and negative) very well.

Question here is How does it find the appropriate plane

I create several hyperplane(for 2D it becomes line)along with two marginal line . I then select the hyperplane and margins which gives the maximum distance between the two. These margins acts like cushions for misclassification(this space gives the flexibility to have some errors)so that we can easily classify that some particular point belongs to which class.

Do I really get so easy and simple linearly separable data?

Answer is No, then you must be thinking how can I face such challenge .Wait, I have very strong trick to get over it. It is called kernel trick. I have several kernels(like : linear, rbf, sigmoid, polynomial)inbuilt within me which can transform the data so that I can separate them easily in different classes. Now you must be thinking how will user get to know which is to be used. User can do hyperparameter tuning to find the best kernel for its data.

Mathematical intuition of SVM

How I check whether particular point is classified correctly or not

If you take a look at the above image you will find two equation written on two marginal lines ,its value can go any higher(for blue sided line)or lower(for green sided line).It is just a particular case of value 1 and -1.If according to my calculation I get the value 1 I will keep it in blue color else -1.Equation written on top of hyperplane, I try to keep it as high as possible for better classification because this value defines the distance between two marginal planes.

That’s all how I work.

For finding the different cases and implementation you can check: https://www.analyticsvidhya.com/blog/2017/09/understaing-support-vector-machine-example-code/

If you like it don’t forget to appreciate it by giving a clap.

See you again. Happy learning!

--

--

Harsh Tiwari
Analytics Vidhya

Data Science learner|| Eager to learn new things || Linkedin :-www.linkedin.com/in/harsh-tiwari-ds