Implemented naive bayes classifier