我能知道NLTK幼稚的Bayes的本质是什么吗?它是Bernoulli,多项式,高斯还是其他任何变体?我阅读了这些文档,但似乎过于笼统了。
据我所知,scikit有4个版本的朴素贝叶斯,其中只有两个适合文本处理。
当我在做文本处理时,我发现NLTK朴素贝叶斯和scikit Bayes之间有很大的不同。
发布于 2020-06-19 20:05:08
NLTK朴素贝叶斯(NLTK朴素贝叶斯)是一类多项式(典型的分类),其线索是高斯朴素贝叶斯通常用于连续的数据(不典型的文本分类)。
NLTK朴素贝叶斯的官方文档可以在这里找到:modules/nltk/classify/naivebayes.html
关键文本示例-
A classifier based on the Naive Bayes algorithm. In order to find the
probability for a label, this algorithm first uses the Bayes rule to
express P(label|features) in terms of P(label) and P(features|label):
| P(label) * P(features|label)
| P(label|features) = ------------------------------
| P(features)
The algorithm then makes the 'naive' assumption that all features are
independent, given the label:
| P(label) * P(f1|label) * ... * P(fn|label)
| P(label|features) = --------------------------------------------
| P(features)
Rather than computing P(features) explicitly, the algorithm just
calculates the numerator for each label, and normalizes them so they
sum to one:
| P(label) * P(f1|label) * ... * P(fn|label)
| P(label|features) = --------------------------------------------
| SUM[l]( P(l) * P(f1|l) * ... * P(fn|l) )https://stackoverflow.com/questions/55154381
复制相似问题