Skip to main content
1 of 2
Tim
  • 141.2k
  • 26
  • 270
  • 512

Naive Bayes algorithm assumes that your features are independent (hence we call it "naive", since it makes the naive assumption about independence, so we don't have to care about dependencies between them). What follows, we model

$$ \begin{align} p(C_k, x_1, x_2, ..., x_n) &\propto p(x_1 | C_k) \, p(x_2 | C_k) \dots p(x_n | C_k) \, p(C_k) \\ &= \prod_{i=1}^n p(x_i|C_k) \, p(C_k) \end{align} $$

So in your example today = (sunny, cool, high, strong), you look at $p($day = sunny $|$ play = yes $)$, and $p($outlook = cool $|$ play = yes $)$, etc.

For more details see the great Wikipedia article on naive Bayes algorithm, the Understanding Naive Bayes thread on our site and the A simple explanation of Naive Bayes Classification thread on StackOverflow.com.

Tim
  • 141.2k
  • 26
  • 270
  • 512