add the naive bayes training model and predict function