21
21
22
22
23
23
import numpy as np
24
- from scipy .sparse import issparse
25
24
26
25
from .base import BaseEstimator , ClassifierMixin
27
26
from .preprocessing import binarize
@@ -141,7 +140,7 @@ class GaussianNB(BaseNB):
141
140
----------
142
141
class_count_ : array, shape (n_classes,)
143
142
number of training samples observed in each class.
144
-
143
+
145
144
class_prior_ : array, shape (n_classes,)
146
145
probability of each class.
147
146
@@ -150,10 +149,10 @@ class labels known to the classifier
150
149
151
150
epsilon_ : float
152
151
absolute additive value to variances
153
-
152
+
154
153
sigma_ : array, shape (n_classes, n_features)
155
154
variance of each feature per class
156
-
155
+
157
156
theta_ : array, shape (n_classes, n_features)
158
157
mean of each feature per class
159
158
@@ -699,7 +698,7 @@ class MultinomialNB(BaseDiscreteNB):
699
698
coef_ : array, shape (n_classes, n_features)
700
699
Mirrors ``feature_log_prob_`` for interpreting MultinomialNB
701
700
as a linear model.
702
-
701
+
703
702
feature_count_ : array, shape (n_classes, n_features)
704
703
Number of samples encountered for each (class, feature)
705
704
during fitting. This value is weighted by the sample weight when
@@ -712,7 +711,7 @@ class MultinomialNB(BaseDiscreteNB):
712
711
intercept_ : array, shape (n_classes, )
713
712
Mirrors ``class_log_prior_`` for interpreting MultinomialNB
714
713
as a linear model.
715
-
714
+
716
715
n_features_ : int
717
716
Number of features of each sample.
718
717
@@ -806,14 +805,14 @@ class ComplementNB(BaseDiscreteNB):
806
805
class_log_prior_ : array, shape (n_classes, )
807
806
Smoothed empirical log probability for each class. Only used in edge
808
807
case with a single class in the training set.
809
-
808
+
810
809
classes_ : array, shape (n_classes,)
811
810
Class labels known to the classifier
812
-
811
+
813
812
feature_all_ : array, shape (n_features,)
814
813
Number of samples encountered for each feature during fitting. This
815
814
value is weighted by the sample weight when provided.
816
-
815
+
817
816
feature_count_ : array, shape (n_classes, n_features)
818
817
Number of samples encountered for each (class, feature) during fitting.
819
818
This value is weighted by the sample weight when provided.
@@ -822,7 +821,7 @@ class ComplementNB(BaseDiscreteNB):
822
821
Empirical weights for class complements.
823
822
824
823
n_features_ : int
825
- Number of features of each sample.
824
+ Number of features of each sample.
826
825
827
826
Examples
828
827
--------
@@ -914,18 +913,18 @@ class BernoulliNB(BaseDiscreteNB):
914
913
class_count_ : array, shape = [n_classes]
915
914
Number of samples encountered for each class during fitting. This
916
915
value is weighted by the sample weight when provided.
917
-
916
+
918
917
class_log_prior_ : array, shape = [n_classes]
919
918
Log probability of each class (smoothed).
920
919
921
920
classes_ : array, shape (n_classes,)
922
921
Class labels known to the classifier
923
-
922
+
924
923
feature_count_ : array, shape = [n_classes, n_features]
925
924
Number of samples encountered for each (class, feature)
926
925
during fitting. This value is weighted by the sample weight when
927
926
provided.
928
-
927
+
929
928
feature_log_prob_ : array, shape = [n_classes, n_features]
930
929
Empirical log probability of features given a class, P(x_i|y).
931
930
@@ -1043,18 +1042,18 @@ class CategoricalNB(BaseDiscreteNB):
1043
1042
class_count_ : array, shape (n_classes,)
1044
1043
Number of samples encountered for each class during fitting. This
1045
1044
value is weighted by the sample weight when provided.
1046
-
1045
+
1047
1046
class_log_prior_ : array, shape (n_classes, )
1048
1047
Smoothed empirical log probability for each class.
1049
1048
1050
1049
classes_ : array, shape (n_classes,)
1051
1050
Class labels known to the classifier
1052
-
1051
+
1053
1052
feature_log_prob_ : list of arrays, len n_features
1054
1053
Holds arrays of shape (n_classes, n_categories of respective feature)
1055
1054
for each feature. Each array provides the empirical log probability
1056
1055
of categories given the respective feature and class, ``P(x_i|y)``.
1057
-
1056
+
1058
1057
n_features_ : int
1059
1058
Number of features of each sample.
1060
1059
0 commit comments