spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Owen <>
Subject Re: Probability in Naive Bayes
Date Tue, 18 Nov 2014 07:09:12 GMT
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" <>

> 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?

View raw message