Making num classes a parameter to naive bayes method