Naive Bayes to Predict a class label

1.7k Views Asked by At

enter image description here

How do I use Naïve Bayes to predict a class label for a test sample $(A=1, B=1, C=1)$

I know Bayes Theorem is:

$$P(C|A) = [P(A|C) P(C)]/P(A)$$ I have no idea how to do this, please help.

1

There are 1 best solutions below

0
On BEST ANSWER

Informally, what Bayes' rule here calculates is: "What is the probability that $C$ occurs if $A$ occurs?"

Now, you already have the formula, just plug in the numbers. $P(A)$ is the probability that event $A$ occurs. This is $P(A)=5/10=1/2$, just count it. Also, counting the frequencies $P(C)=5/10=1/2$.

$P(A|C)$ is just: what is the probability that $A$ occurs if $C$ occured? Counting again, $P(A|C)=3/5$. Putting together: $$P(C|A) = \frac{P(A|C) P(C)}{P(A)}=\frac{3/5 \cdot 1/2}{1/2}=3/5,$$ that is, 60%.