-2

I'm using the libSVM for .net. After running the SVM training i get a vector of alphas. As i understand, the margin is the minimum distance between any point and the decision hyperplane.

I'm not sure how to do that using the alphas.

Thanks.

AGS
  • 14,288
  • 5
  • 52
  • 67
Daniel Miron
  • 460
  • 3
  • 14

1 Answers1

2

Q: How do I get the distance between a point and the hyperplane?

The distance is |decision_value| / |w|. We have |w|^2 = w^Tw = alpha^T Q alpha = 2*(dual_obj + sum alpha_i). Thus in svm.cpp please find the place where we calculate the dual objective value (i.e., the subroutine Solve()) and add a statement to print w^Tw.

From the libsvm FAQ:

Community
  • 1
  • 1
AGS
  • 14,288
  • 5
  • 52
  • 67