added code to naive bayes to obtain confusion matrix