Python implementation of Naive Bayes for clustering