Orange Forum • View topic - The meaning of getProbabilities

The meaning of getProbabilities

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

The meaning of getProbabilities

Postby Guest » Tue Nov 02, 2004 23:51

When calling a classifier with orange.getProbabilities, I got a list of probabilities. My question is what is the order of the returned probabilities. How can I figure out which prob corresponds to which class?

thanks .

Postby Blaz » Fri Nov 05, 2004 16:13

Probabilites in the list returned by some orange classifier, when
getProbabilities is passed as an argument, are probabilities of
class values. The order matches the order of a list of values for
the class, which can be obtained by

data.domain.classVar.values

where data is the data set from whcih the classifier was build.

Postby Guest » Sat Nov 20, 2004 18:26

Thanks for the reply. I made a simple example with lenses.py and lenses.tab.
I add
print data.domain.classVar.values
in lenses.py

The first run prints:
Then I swaped the first(none) and second(soft) samples in lenses.tab
And I got:
<soft, none, hard>

This implies the user should always consult data.domain.classVar.values to get correct order of the outputed probability because of the way data being loaded.

I suggest this be added into the document. Trying to figure out the meaning of the probabilities really confuses me for a while.

Thanks.

Postby Guest » Sat Nov 20, 2004 18:29

Sorry. I omitted the output from the first run. It should be:
<none, soft, hard>

Postby Blaz » Mon Nov 22, 2004 17:00

This implies the user should always consult data.domain.classVar.values to get correct order of the outputed probability because of the way data being loaded.

You're right. But if you would like to always have the same order of class values, list them in your data file. For that, you should use tab-delimited data file, where in the second line instead of using "discrete" for a class value, list the attribute values (separate them with spaces, see http://www.ailab.si/orange/doc/referenc ... imited.htm).

To be on a safe side, though, rely on data.domain.classVar.values.


Return to Questions & Support