Orange Forum • View topic - meta attributes and learner

meta attributes and learner

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

meta attributes and learner

Postby lollix89 » Sun May 06, 2012 10:59

hi, i'm trying to use the naive bayes learner of Orange with a dataset imported from a tab file that i created. Everything works fine except when i add a meta field to the tab file and as soon as i try to create the learner with Orange.classification.bayes.NaiveLearner(dataset) i get a kernelException saying 'orange.BayesLearner': discrete class attribute expected. :?
I post the first few lines of my dataset. Thanks a lot for your help!!!

keyphrase TFIDF TFIDFZeros FirstOccurrence isAcronym POSTaggingHash suffix in_title num_head is_key
string c c c d d d d c d
meta class
h 0.705482023722 0.9 0.478012802672 0 27e4552882a299c108e8683ba4bfe75b7f5bab13 083dbabef569d46bf2ed5937e359fb78e42fbb0d 0 2 0
p 0.580482023722 0.8 0.273309212357 0 8ac00a7e70abeeaf254830eb6d9428e78c8d7ef4 083dbabef569d46bf2ed5937e359fb78e42fbb0d 0 4 0

Re: meta attributes and learner

Postby Ales » Mon May 07, 2012 10:49

I assume the class variable should be the 'is_key' column (the forum does not preserve tab formating). You probably have inconsistent tab indentation in the third row. Make sure there are 9 tabs after the 'meta' flag and before the 'class' flag.

You can also check which variable is the class variable with
Code: Select all
print dataset.domain.class_var
For instance if this were to output "Orange.feature.Continuous 'num_head'", it would mean that you are missing one tab in the third row.

Return to Questions & Support