# How to calculate the margin in SVM light?

I'm using Support Vector Machine in a project. The library chosen is SVM light of Joachims: http://svmlight.joachims.org/

I have the need to calculate the margin. Namely, given a training set of data I have to calculate the margin of the better hyperplane found. But I do not see a direct way to do this in svm light. So I'll ask you to know how to do it. The data should be linearly separable and in this case I expect a positive margin, but there is also the remote possibility that in some case the data arent't linearly separable and in this case I expect a negative margin. (I use hard margin) Is there a possibility to do that in this library?

With the weight vector you can calculate the margin by doing one over its norm: $\frac{1}{\lVert w \rVert}$