rusty-machine icon indicating copy to clipboard operation
rusty-machine copied to clipboard

naïve Bayes should tell us probability of class membership?

Open zackmdavis opened this issue 8 years ago • 3 comments

The docs say (and what I would have expected from my textbook reading elsewhere) that we "compute the probability that each input belongs to a given class", but the actual code seems to just predict the most likely class (marked as 1. in the result matrix). Shouldn't we get the probabilities for each class, or am I missing something?

zackmdavis avatar Sep 23 '16 06:09 zackmdavis

You might be missing the get_log_probs function.

I say might as your point is still relevant. I chose to have predict return the class labels and hid the probabilities in a separate function. I believe that get_log_probs essentially does the same thing as predict but without getting the labels.

AtheMathmo avatar Sep 23 '16 06:09 AtheMathmo

documentation bug, then (I know, patch or STFU)

zackmdavis avatar Sep 23 '16 06:09 zackmdavis

I know, patch or STFU

Ha! No, it's really valuable to be made aware of these things.

It is also an option to change the api - we have some breaking changes pending right now. If you want to suggest an update now is a good time. Otherwise I'm happy to try and update the docs (I'd appreciate you reading it over if I do though!)

AtheMathmo avatar Sep 23 '16 07:09 AtheMathmo