# How to compute denominator in Naive Bayes?

Suppose we have class C_k and input feature vector x in dataset

How to calculate probability p(x)?

• Do you need p(x)?, note that for classification with Naive Bayes one doesnt need it. Mar 14 '20 at 15:17
• Your correct Naive Bayes doesn't need it, therefore, it's a more theoretical question Mar 14 '20 at 16:15

in the Examples section of the Wikipedia article there is a nice example. The calculation of $$p(\mathbf{x})$$ can be done via
$$p(\mathbf{x}) = \sum_k p(C_k) \ p(\mathbf{x} \mid C_k)$$
$$p(\mathbf{x} \mid C_k) = \Pi_{i} \, p(x_i \mid C_k)$$