Naive Bayes Code