class sklearn.naive_bayes.MultinomialNB(alpha=1.0, fit_prior=True, class_prior=None)
Parameters:
alpha : float, optional (default=1.0)
Additive (Laplace/Lidstone) smoothing parameter (0 for no smoothing).
(拉普拉斯/Lidstone)平滑参数(0表示没有平滑)。
fit_prior : boolean, optional (default=True)
Whether to learn class prior probabilities or not. If false, a uniform prior will be used.
是否学习类先验概率。如果为假,则使用统一先验。
class_prior : array-like, size (n_classes,), optional (default=None)
Prior probabilities of the classes. If specified the priors are not adjusted according to the data.
Attributes:
class_log_prior_ : array, shape (n_classes, )
Smoothed empirical log probability for each class.
intercept_ : property
Mirrors class_log_prior_ for interpreting MultinomialNB as a linear model.
feature_log_prob_ : array, shape (n_classes, n_features)
Empirical log probability of features given a class, P(x_i|y).
coef_ : property
Mirrors feature_log_prob_ for interpreting MultinomialNB as a linear model.
class_count_ : array, shape (n_classes,)
Number of samples encountered for each class during fitting. This value is weighted by the sample weight when provided.
feature_count_ : array, shape (n_classes, n_features)
Number of samples encountered for each (class, feature) during fitting. This value is weighted by the sample weight when provided.
七、朴素贝叶斯算法小结