Orange Forum • View topic - SVM : how to output the value of the function

SVM : how to output the value of the function

A place to ask questions about methods in Orange and how they are used and other general support.

SVM : how to output the value of the function

Postby deep » Wed Feb 21, 2007 16:47

Hi all,
Tipicaly the svm classifier compute the value of the function
f = sum_i K(.,x_i) + b
and if we want to classify we theshold the value of f (f > 0) with a new input data. With orange, I always get the class value of my input so how can I do to retrive the real value of my function f.

Thanks for your help,


Deep

Postby Ales » Fri Mar 23, 2007 9:34

Well, you will have to use the latest (today's) snapshot for this to work.

You can use the SVMClassifier.getDecisionValues(example) method.It takes the example you are trying to classify and returns the float values of the decision function's for each internal class vs. class classifier. The order is [class1 vs. class2, class1 vs. class3 ... class1 vs. classN, class2 vs. class3 ... class2 vs classN, ... classN-1 vs classN].
So basically for a binary class prediction you just call svmc.getDecisionValues(example)[0]


Return to Questions & Support