A Naive Bayes based prediction algorithm