Naive Bayes sample implementation