Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to understand the functional margin in SVM ?

I'm reading Andrew NG's Machine Learning notes, but the functional margin definition confused me :

enter image description here

I can understand to geometric margin is the distance from x to its hyperplane, but how to understand functional margin ? And why they define its formula like that ?

like image 940
WoooHaaaa Avatar asked Feb 02 '13 04:02

WoooHaaaa


People also ask

What is functional margin in SVM?

Summary: The functional margin represents the lowest relative "confidence" of all classified points, while the geometric margin represents the smallest distance from xi to the hyperplane. Functional margin: ˆγi=yi(wTx+b) Geometric margin: γi=yi((w|w|)Txi+b|w|)

How does SVM calculate margin?

The margin is calculated as the perpendicular distance from the line to only the closest points. Only these points are relevant in defining the line and in the construction of the classifier. These points are called the support vectors.

Why is geometrical margin preferred over functional margin?

Functional margin is like a binary valued or boolean valued variable: if we have correctly classified a particular data unit or not. So, this cannot be maximised. However, geometric margin for the same data unit gives a magnitude to our confidence, and tells us how correct we are.So, this we can maximise.


2 Answers

Think of it like this: w^T.x_i +b is the model's prediction for the i-th data point. Y_i is its label. If the prediction and ground truth have the same sign, then gamma_i will be positive. The further "inside" the class boundary this instance is, the bigger gamma_i will be : this is better because, summed over all i, you will have greater separation between your classes. If the prediction and the label don't agree in sign, then this quantity will be negative (incorrect decision by the predictor), which will reduce your margin, and it will be reduced more the more incorrect you are (analogous to slack variables).

like image 125
Ben Allison Avatar answered Nov 15 '22 07:11

Ben Allison


Functional Margin:

This gives the position of the point with respect to the plane, which does not depend on the magnitude.

Geometric Margin:

This gives the distance between the given training example and the given plane.

like image 30
chk Avatar answered Nov 15 '22 07:11

chk