Orange Forum • View topic - BayesLearner return NaN as probability

BayesLearner return NaN as probability

Report bugs (or imagined bugs).
(Archived/read-only, please use our ticketing system for reporting bugs and their discussion.)
Forum rules
Archived/read-only, please use our ticketing system for reporting bugs and their discussion.

BayesLearner return NaN as probability

Postby Rokm » Tue Jun 01, 2010 15:24

Hello!

I've come across a problem with Naive Bayes implementation. Using below datasets for training and testing we get "nan" for probabilities of classes.

Code: Select all
train, test = orange.ExampleTable('train'), orange.ExampleTable('test')

res = orngTest.learnAndTestOnTestData([orange.BayesLearner], train, test)

map(lambda x:x.probabilities, res.results)
[[[nan, nan]]]


best regards,
Rok & Anze

train.tab
--------------------------------------

att4 class
continuous 0 1
class
0 0
0.48 0
0.48 1
0.48 0
0.535 0
0.535 0
0.535 0
0.535 0
0.523 0
0.523 0
0.523 0
0.523 0
0.523 0
0.523 0
0.523 1
0.523 1
0.523 1
0.523 1
0.523 1
0.523 1
0.535 1

test.tab
-------------------------

att1 att2 att3 att4 att5 razred
continuous continuous continuous continuous continuous 0 1
class
? ? ? 0.523 ? 0

Postby Janez » Thu Jun 03, 2010 13:02

Dear Rok and especially Anze,

I am not sure which Anze you are, but if you are the right one, then please know this: your unfortunate selection of data forced me to debug the loess code. This is not something I can easily forgive. :)

I fixed it (I hope). It on the SVN and it will be in tomorrow's snapshot.

Janez

Postby Rokm » Fri Jun 04, 2010 17:13

Hey!

Thanks for the quick repair, but after updating to the latest snapshot there's a problem with loading ExampleTable from .tab file, all the columns go into attributes even if attribute was tagged as class or meta.

Rok

Postby Janez » Fri Jun 04, 2010 18:15

This was a bad fix for an unrelated bug. I "unfixed" it, so this version should be OK for you.


Return to Bugs