Practice code for implementing naive-bayes