The Naive Bayes classifier is a probabilistic classifier that applies Bayes’ theorem with a strong (“naive”) assumption of conditional independence among the features (attributes).

It calculates the probability of each possible class given the observed attribute values and selects the class with the highest posterior probability.

The classifier is defined by the formula: where is the predicted class, is a possible class, and are the attribute values of the instance to be classified.

Note: Naive Bayes Classifier uses attributes directly instead of hypotheses!

The terms are estimated from the training data as follows:

  • Class Prior (): This is estimated by the frequency of class in the dataset. It is the number of training instances in class divided by the total number of training instances.
  • Attribute Likelihood (): This is estimated by counting the frequency of attribute value among only those instances that belong to class . It is the number of instances in class with attribute value , divided by the total number of instances in class .