Skip to content
Prev 276906 / 398506 Next

[klaR package] [NaiveBayes] warning message numerical 0 probability

Uwe Ligges <ligges <at> statistik.tu-dortmund.de> writes:
Hello,

I am following this thread after it's one year old!

I am also getting the warnings for probabilities=0, but for ALL observations! 
I am using NaiveBayes() to obtain the posteriors of all training examples (29
classes; 49 numeric continuous variables, 700 examples), thus the command:

my.model <-NaiveBayes(class ~ ., data = data, usekernel = TRUE)

predict(my.model)

as expected, it returns predicted classes and a matrix of posteriors for each
training examples, BUT with this warning for ALL training examples. Still the
accuracy is ~60% and is within expectation.
Please give some comments, Is this possible?? Should I ignore the warnings??

The posteriors returned look like this:

         Class1       class2        class3        class4  ...
1  6.725408e-58  0.999999996  4.277379e-09  2.923033e-90
2  4.443767e-48  0.997316780  2.683220e-03  1.710466e-75
3  3.348223e-40  0.999993916  6.799327e-08  6.760083e-81
... ...

Sorry I am replying via the Gmane interface and cannot attach my dataset. But I
am starting to follow this mailing list now, so may be able to reply with
attachments to the next message.

grateful for any comments!

Ted Chang