Orange Forum • View topic - How to get the number of support vectors?

How to get the number of support vectors?

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

How to get the number of support vectors?

Postby re832003 » Sun Jun 16, 2013 4:48

How do I get the number of support vectors in the following code?

Code: Select all
import Orange, cPickle
from Orange.classification import svm


data = Orange.data.Table("input.tab")
classifier = svm.MultiClassSVMLearner(data, folds=10)
cPickle.dump(classifier, open("multi_svm.pck", "wb"))


# later:


classifier = cPickle.load(open('multi_svm.pck'))
data_validation = Orange.data.Table('unseen_test.tab')
print 'predictions:'
for e in data_validation:
    print e[3], "\t", classifier(e) # predictions

   


Thanks

Re: How to get the number of support vectors?

Postby marko » Sun Jun 16, 2013 8:16

Multiclass SVM from Orange uses LIBLINEAR and the parameters of the model are stored as classifier.weights.

Re: How to get the number of support vectors?

Postby re832003 » Mon Jun 17, 2013 3:44

I'm not sure I can fine the documentation about how to use classifier.weights

Re: How to get the number of support vectors?

Postby Ales » Thu Jun 20, 2013 10:56

re832003 wrote:How do I get the number of support vectors in the following code?

You actually can't recover the support vectors when using the MultiClassSVMLearner (or other learners based on LIBLINEAR). Consider using SVMLearner instead.


Return to Questions & Support



cron