I'm reading Andrew NG's Machine Learning notes, but the functional margin definition confused me :
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 ?
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|)
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.
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.
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).
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With