Orange Forum • View topic - Using a UID in a Table

Using a UID in a Table

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

Using a UID in a Table

Postby djwonk » Sat Nov 10, 2012 2:30

I have a UID (a String type) in a Table. I remove the UID in order to process the data with a classifier. (This is necessary, right?) But I need to keep the UID so I can cross-reference a Data Instance (a row of data) with other parts of my application. What should I do?

Re: Using a UID in a Table

Postby marko » Sat Nov 10, 2012 10:29

Classificators in Orange typically ignore string attributes (I can not think of any that use it), so you can safely leave them in your data table.

To ignore any variable during learning, just convert it to a meta attribute.

Best regards,
Marko

Re: Using a UID in a Table

Postby djwonk » Sat Nov 10, 2012 16:51

Are you sure? If I do not remove the String attributes, I get this error:

orange.KernelException: Distribution: unknown value type

from this code:

learner = Orange.classification.bayes.NaiveLearner(name = "NB", adjust_threshold = True)
classifier = learner(data)

Re: Using a UID in a Table

Postby djwonk » Sat Nov 10, 2012 18:31

Ok, I've got this working. I remove the String attributes for training. But I keep them in for testing. That way I can output the UID alongside the predicted probabilities.


Return to Questions & Support



cron