I am trying to do a simple Naive Bayes classification, but I am getting a probability greater than zero. What am I doing wrong? I have included my calculations below.

Step 1: Prior. Calculate the prior probability of the class, i.e., the probability we would assign to the class before seeing any evidence. What percentage of all customers have churned? 0.48

Step 2: Evidence. Calculate the likelihood of the evidence: how common is the evidence among all examples? What percentage of all customers have a BS210 handset? 0.12

Step 3: Likelihood. Calculate the likelihood of seeing the evidence, given the class. What percentage of customers with a BS210 handset have churned? 0.916666667

Step 4: Posterior. Calculate the posterior probability of the class for a particular example. Given a new customer with BS210 handset, what is the likelihood that the customer will churn? Posterior = (Likelihood * Prior)/Evidence 3.666666667


Assuming that your numbers are calculated correctly, your Bayes formula has no problem. And yes, $3.6$ ($> 1$) cannot be correct.

From your explanation, I can guess that you might have gotten the "Likelihood" wrong:

Step 3: Likelihood. ... What percentage of customers with a BS210 handset have churned

should be: What percentage of customers have churned, given they had BS210.

$p(E|H) = p(\text{customer has churned}|\text{bought BS210})$.

Bayes is all about $p(A|B)$ or $p(B|A), after all.

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.