Different results between the Bernoulli Naive Bayes in NLTK and in scikit-learn

这一生的挚爱 提交于 2019-11-28 10:28:29

问题


I am getting quite different results when classifying text (in only two categories) with the Bernoulli Naive Bayes algorithm in NLTK and the one in scikit-learn module. Although the overall accuracy is comparable between the two (although far from identical) the difference in Type I and Type II errors is significant. In particular, the NLTK Naive Bayes classifier would give more Type I than Type II errors , while the scikit-learn -- the opposite. This 'anomaly' seem to be consistent across different features and different training samples. Is there a reason for this ? Which of the two is more trustworthy?


回答1:


NLTK does not implement Bernoulli Naive Bayes. It implements multinomial Naive Bayes but only allows binary features.



来源:https://stackoverflow.com/questions/15732769/different-results-between-the-bernoulli-naive-bayes-in-nltk-and-in-scikit-learn

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!