Orange Forum • View topic - Converting data into domain of SVM-classifier

Converting data into domain of SVM-classifier

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

Converting data into domain of SVM-classifier

Postby holbech » Wed Jun 13, 2012 15:07

I work in the canvas and have a problem with using my learned SVMs for classifying more data. I really hope that someone can explain how I do this, as I have been unable to learn from the documentation and the python sources.

Basically, I work in the Canvas, where I have two datasets, A and B, over the same domain. I train a classifier, c, on A, and then want to apply it to the instances in B. I do this with a python script node, that basically does

Code: Select all
for i in in_data:
    print in_classifier(i)


This works for most classifiers, but not the SVM, as that transforms the input domain to its own normalized feature space. What I cannot see, is how that I can transform the cases in B in the same manner. How do I get at the "normalization transform" and apply it to my cases?

Re: Converting data into domain of SVM-classifier

Postby Ales » Thu Jun 14, 2012 12:29

holbech wrote:How do I get at the "normalization transform" and apply it to my cases?

SVMClassifier does domain transformation on new examples automatically. But if you want to do this manually, use
Code: Select all
data = Orange.data.Table(in_classifier.domain, in_data)

Re: Converting data into domain of SVM-classifier

Postby holbech » Tue Jun 19, 2012 11:11

Ah. Thank you. I thought the domain-attribute of the classifier corresponded to the mathematical term "domain" - i.e. the legal input - which managed to confused me so much that I didn't thought of applying my cases directly.


Return to Questions & Support