News for hackers. Stuff that matters.
Re:How To Build a Naive Bayes Classifier by bad_user on Monday February 27, 2012 @04:39AM (#3638383)
I'm the author of the article ...

Yes you are right, it's better to convert the whole thing to a sum of logs, otherwise you end up with floating-point underflow.

The article was getting already too long however, but I'll add a note about it because it is an important optimization that affects both speed and even correctness (because of the underlying limitations of floating point).

UPDATE: note added.

Re:How To Build a Naive Bayes Classifier by ppod on Monday February 27, 2012 @08:26AM (#3638855)
Is the sum of logs method mathematically equivalent to the multiplication of probabilities (i.e. will it always produce a monotonic ordering of class predictions)?
Re:How To Build a Naive Bayes Classifier by alexchamberlain on Monday February 27, 2012 @11:04AM (#3639397)
log(AB) = log(A) + log(B) for all A, B real numbers
Re:How To Build a Naive Bayes Classifier by phaedon on Monday February 27, 2012 @11:20AM (#3639446)
Only for A, B > 0, but that's good enough for probabilities (except 0, I guess)
Re:How To Build a Naive Bayes Classifier by alexchamberlain on Monday February 27, 2012 @11:34AM (#3639501)
That was there to test you...