# Naive Bayes compute P(y|X) with conditional prob-ability

Does the Naive Bayes algorithm accurately compute P(y|X), i.e., the conditional prob-ability of class given features?

Naive Bayes algorithm makes the "naive" assumption, that the features are (conditionally) independent, so by definition of independence

$$p(x_1, x_2, \dots, x_k \mid y) = \prod_{i=1}^k p(x_i | y)$$

Answering your question, the estimate of conditional probability would be accurate if the assumption of independence holds (and in real life it almost never does). To give example, say that you want to predict if weather is "bad" given set of meteorological data. By assuming conditional independence, you say that if the weather is "bad" then it the fact that it is very cold is independent of the fact that it is snowing, so if you are told that the weather is bad, then no matter if it is very cold, or extremely hot, the probability that it snows is the same in both cases.

Additionally, for the probabilities to be correct, you would need to use relatively large sample to estimate them precisely, as with any other statistical method.

• Thank you ;) That was a great answer. It explained the point that I was trying to answer. Commented Feb 28, 2019 at 19:52