finalize naive-bayes