首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >NLTK与Scikit朴素贝叶斯的区别

NLTK与Scikit朴素贝叶斯的区别
EN

Stack Overflow用户
提问于 2019-03-14 03:10:02
回答 1查看 385关注 0票数 2

我能知道NLTK幼稚的Bayes的本质是什么吗?它是Bernoulli,多项式,高斯还是其他任何变体?我阅读了这些文档,但似乎过于笼统了。

据我所知,scikit有4个版本的朴素贝叶斯,其中只有两个适合文本处理。

当我在做文本处理时,我发现NLTK朴素贝叶斯和scikit Bayes之间有很大的不同。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-06-19 20:05:08

NLTK朴素贝叶斯(NLTK朴素贝叶斯)是一类多项式(典型的分类),其线索是高斯朴素贝叶斯通常用于连续的数据(不典型的文本分类)。

NLTK朴素贝叶斯的官方文档可以在这里找到:modules/nltk/classify/naivebayes.html

关键文本示例-

代码语言:javascript
复制
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) )
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55154381

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档