Implementation of Naive Bayes Classifier algorithm.