Orange Forum • View topic - Probability of a prediction with orangeLR

Probability of a prediction with orangeLR

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

Probability of a prediction with orangeLR

Postby michaelhecht » Wed Jan 13, 2010 16:31

If I predict a value using orangeLR.LogRegLearner I get immediately the predicted class. If the LogReg-Value is close to 0.5 I want to know this, since then I could print out the information.

So how can I get the result of the calculation prior to assigning the predicted class?

Postby bgbg » Thu Jan 14, 2010 10:45

use orange.GetProbability, orange.GetValue or orange.GetBoth:

Code: Select all

In [68]: n = orange.ExampleTable(newdomain, data)

In [69]: classifier = orngLR.LogRegLearner(n)

In [70]: for (i, e) in enumerate(n):
   ....:     print i, classifier(e, orange.GetBoth)
   ....:
   ....:
0 (<orange.Value 'category'='positive'>, <0.700, 0.300>)
1 (<orange.Value 'category'='positive'>, <0.502, 0.498>)
2 (<orange.Value 'category'='positive'>, <0.589, 0.411>)
3 (<orange.Value 'category'='positive'>, <0.553, 0.447>)
4 (<orange.Value 'category'='positive'>, <0.601, 0.399>)
5 (<orange.Value 'category'='positive'>, <0.654, 0.346>)
6 (<orange.Value 'category'='positive'>, <0.521, 0.479>)
7 (<orange.Value 'category'='control'>, <0.358, 0.642>)
8 (<orange.Value 'category'='control'>, <0.395, 0.605>)
9 (<orange.Value 'category'='control'>, <0.332, 0.668>)
.
.
.
.


Thank you

Postby michaelhecht » Thu Jan 14, 2010 18:45

This is exacly what I was looking for, thank you.

But where is this documented. Sometimes it seems that the orange documentation is quite incomplete.


Return to Questions & Support



cron