Probability in Naive Bayes

2014-11-17 Thread Samarth Mailinglist
I am trying to use Naive Bayes for a project of mine in Python and I want
to obtain the probability value after having built the model.

Suppose I have two classes - A and B. Currently there is an API to to find
which class a sample belongs to (predict). Now, I want to find the
probability of it belonging to Class A or Class B.

Can you please provide any details about how I can obtain the probability
values for it belonging to the either class A or class B?


Re: Probability in Naive Bayes

2014-11-17 Thread Sean Owen
This was recently discussed on this mailing list. You can't get the
probabilities out directly now, but you can hack a bit to get the internal
data structures of NaiveBayesModel and compute it from there.

If you really mean the probability of either A or B, then if your classes
are exclusive it is just the sum of the class probabilities. You won't be
able to compute this otherwise from what Naive Bayes computes.
On Nov 18, 2014 7:42 AM, Samarth Mailinglist mailinglistsama...@gmail.com
wrote:

 I am trying to use Naive Bayes for a project of mine in Python and I want
 to obtain the probability value after having built the model.

 Suppose I have two classes - A and B. Currently there is an API to to find
 which class a sample belongs to (predict). Now, I want to find the
 probability of it belonging to Class A or Class B.

 Can you please provide any details about how I can obtain the probability
 values for it belonging to the either class A or class B?