What is the meaning ( or interpretation ) of the return value of the Compute function

38 views
Skip to first unread message

charle...@gmail.com

unread,
Nov 8, 2014, 10:49:16 PM11/8/14
to accor...@googlegroups.com
Hi,

If svm is a trained SupportVectorMachine, and if I compute an input vector, i.e.

var value = svm.Compute(input);

Then "What is the meaning ( or interpretation ) of "value"?

Charles

César

unread,
Nov 9, 2014, 4:11:04 AM11/9/14
to accor...@googlegroups.com
Hi Charles,

The output can be interpreted as the distance, in feature space, from the input vector and the separating hyperplane. A positive value means the sample lies on one side of the hyperplane, whereas a negative value means it lies on the other.

Hope it helps!

Best regards,
Cesar

charle...@gmail.com

unread,
Nov 12, 2014, 12:18:52 PM11/12/14
to accor...@googlegroups.com
Hi Cesar,

Thanks for the reply. The reason I asked this question is because I have trained a SVM and stored the engine in a file using "svm.Save(fileName);".

My application program then loads the SVM engine and does a "Compute", using a new input vector. I would like to know how good the prediction is. Is there any way of computing something similar to the Accuracy method of a ConfusionMatrix?

Thanks in advance.

Charles

Message has been deleted

César

unread,
Nov 12, 2014, 12:44:21 PM11/12/14
to accor...@googlegroups.com
Hi Charles,

Yes, there is. In this case, just take the sign of the value given by the SVM. If the sign is positive, it meant the point should be classified as belonging to label +1. If it is negative, then it should be classified as belonging to label -1. 

Now, assuming that you have a vector containing the true labels for your samples (i.e. the value they should have been assigned), you can equally create another vector, of the same size, containing all label assignments that the SVM produced, for the same points.

Afterwards, you can pass those two vectors to ConfusionMatrix; one as the expected vector (the ground truth, the values that should have been predicted), and the other one as the actual vector (the predicted values, generated by the taking the sign of the value generated when calling the Compute method of the SVM).
Reply all
Reply to author
Forward
0 new messages