Training a naive Bayes classifier