朴素贝叶斯
朴素贝叶斯是一系列监督学习算法,在每对特征值相互条件独立的假设上,使用贝叶斯定理。
不同的贝叶斯分类器主要在于其关于 P ( x i ∣ y ) P(x_i | y) P(xi∣y)的假设不同。尽管使用了这种过于简化的假设,朴素贝叶斯在文件分类和垃圾邮件过滤上应用广泛。他们仅需要很少的训练数据即可估计必要的参数。
Gaussian Naive Bayes
GaussianNB
implements the Gaussian Naive Bayes algorithm for classification.
Multinomial Naive Bayes
MultinomialNB
implements the naive Bayes algorithm for multinomially distributed data.
Complement Naive Bayes
ComplementNB
implements the complement naive Bayes algorithm. It is an adaption of the standard multinomial naive Bayes algorithm that is particularly suited for imbalanced data sets.
Bernoulli Naive Bayes
BernoulliNB
implements the naive Bayes training and classification algorithms for data that is distributed according to multivariate Bernoulli distributions; i.e., there may be multiple features but each one is assumed to be a binary-valued variable.
Categorical Naive Bayes
CategoricalNB
implements the categorical naive Bayes algorithm for categorically distributed data. It assumes that each feature, which is described by the index, has its own categorical distribution.
Out-of-core naive Bayes model fitting
朴素贝叶斯可以用于处理大型分类问题,即使整个训练集不能全部载入内存中。为了应对这种情况,MultinomialNB
/BernoulliNB
/GaussianNB
提供了partial_fit
方法。