The NB classifier is based on Bayes' theorem, with the following assumptions:
- Independence between every pair of features
- Feature values are non-negative, such as counts
For example, if cancer is related to age, this can be used to assess the probability that a patient might have cancer. Bayes' theorem is stated mathematically as follows:
In the preceding equation, A and B are events with P (B) ≠ 0. The other terms can be described as follows:
- P (A | B) is called the posterior or the conditional probability of observing event A, given that B is true
- P (B| A) is the likelihood of event B given that A is true
- P(A) is the prior and P(B) is the prior probability, also called marginal likelihood or marginal probability
Gaussian NB is a generalized version of NB that's used for classification, which is based on the binomial distribution...