Trouble reading multinomial naive bayes notation

98 Views Asked by At

$C_m$: m = most likely class (wanted to write C subscript MAP for "maximum a posteriori" but couldn't do MAP with MathJax)

$C_N$: N= NB = Naive Bayes (I wanted to write C subscript NB, but couldn't do both letters as above)

x: document d is represented as $x_n$ features or words

$c_j$: I think it's a class j

Source is here on page 27: http://www.stanford.edu/class/cs124/lec/naivebayes.pdf


Anyway,

$$ \begin{aligned} C_m &= \mathop{\text{argmax}}_{c\in C} P(c|d) \\&= \mathop{\text{argmax}}_{c \in C} \frac{P(d|c)P(c)}{P(d)} \qquad \text{(Bayes Rule)} \\&= \mathop{\text{argmax}}_{c\in C} P(d|c)P(c) \end{aligned}$$

Firstly, I thought Bayes Rule was just $\frac{P(d|c)}{P(d)}$, which is just conditional probability of the number of occurrences of {c & d}/d, so why is $P(c)$ multiplied by $P(d|c)$? And why is $c|d$ flipped to $d|c$?

Also, for multinomial naive bayes classifier, we have:

$$C_N = \mathop{\text{argmax}}_{c \in C} P(c_j)\prod P(x | c). $$

I'm not sure how to read that equation... Is it saying Classifiers for N = the max probability of class j * PI of x in X * Probability of (x given c)?

If someone could help break down that notation that would be great.

Thanks!