CODE: basic version of the naive bayes classifier, to be later improved