Given a
training set the naïve Bayes algorithm first
estimates the prior probability P (Cj) for
each class by counting how often each class
occurs in the training data. For ach attribute
value xi can be counted to determine P (xi).
Similarly the probability P (xi | Cj) can be
estimated by counting how often each value
occurs in the class in the training data.