8000 alphabetized and added attributes to naive_bayes.py · scikit-learn/scikit-learn@7c54edc · GitHub
[go: up one dir, main page]

Skip to content

Commit 7c54edc

Browse files
committed
alphabetized and added attributes to naive_bayes.py
1 parent ea006d3 commit 7c54edc

File tree

1 file changed

+57
-64
lines changed

1 file changed

+57
-64
lines changed

sklearn/naive_bayes.py

+57-64
Original file line numberDiff line numberDiff line change
@@ -139,26 +139,23 @@ class GaussianNB(BaseNB):
139139
140140
Attributes
141141
----------
142-
class_prior_ : array, shape (n_classes,)
143-
probability of each class.
144-
145142
class_count_ : array, shape (n_classes,)
146143
number of training samples observed in each class.
144+
145+
class_prior_ : array, shape (n_classes,)
146+
probability of each class.
147147
148148
classes_ : array, shape (n_classes,)
149149
class labels known to the classifier
150150
151-
theta_ : array, shape (n_classes, n_features)
152-
mean of each feature per class
153-
154-
sigma_ : array, shape (n_classes, n_features)
155-
variance of each feature per class
156-
157151
epsilon_ : float
158152
absolute additive value to variances
159-
160-
classes_ : array-like, shape (n_classes,)
161-
Unique class labels.
153+
154+
sigma_ : array, shape (n_classes, n_features)
155+
variance of each f 8000 eature per class
156+
157+
theta_ : array, shape (n_classes, n_features)
158+
mean of each feature per class
162159
163160
Examples
164161
--------
@@ -689,38 +686,36 @@ class MultinomialNB(BaseDiscreteNB):
689686
690687
Attributes
691688
----------
692-
class_log_prior_ : array, shape (n_classes, )
693-
Smoothed empirical log probability for each class.
694-
695-
intercept_ : array, shape (n_classes, )
696-
Mirrors ``class_log_prior_`` for interpreting MultinomialNB
697-
as a linear model.
698-
699-
feature_log_prob_ : array, shape (n_classes, n_features)
700-
Empirical log probability of features
701-
given a class, ``P(x_i|y)``.
702-
703-
coef_ : array, shape (n_classes, n_features)
704-
Mirrors ``feature_log_prob_`` for interpreting MultinomialNB
705-
as a linear model.
706-
707689
class_count_ : array, shape (n_classes,)
708690
Number of samples encountered for each class during fitting. This
709691
value is weighted by the sample weight when provided.
710692
693+
class_log_prior_ : array, shape (n_classes, )
694+
Smoothed empirical log probability for each class.
695+
711696
classes_ : array, shape (n_classes,)
712697
Class labels known to the classifier
713698
699+
coef_ : array, shape (n_classes, n_features)
700+
Mirrors ``feature_log_prob_`` for interpreting MultinomialNB
701+
as a linear model.
702+
714703
feature_count_ : array, shape (n_classes, n_features)
715704
Number of samples encountered for each (class, feature)
716705
during fitting. This value is weighted by the sample weight when
717706
provided.
718707
708+
feature_log_prob_ : array, shape (n_classes, n_features)
709+
Empirical log probability of features
710+
given a class, ``P(x_i|y)``.
711+
712+
intercept_ : array, shape (n_classes, )
713+
Mirrors ``class_log_prior_`` for interpreting MultinomialNB
714+
as a linear model.
715+
719716
n_features_ : int
720717
Number of features of each sample.
721718
722-
classes_ : array-like, shape (n_classes,)
723-
Unique class labels.
724719
725720
Examples
726721
--------
@@ -804,33 +799,30 @@ class ComplementNB(BaseDiscreteNB):
804799
805800
Attributes
806801
----------
807-
class_log_prior_ : array, shape (n_classes, )
808-
Smoothed empirical log probability for each class. Only used in edge
809-
case with a single class in the training set.
810-
811-
feature_log_prob_ : array, shape (n_classes, n_features)
812-
Empirical weights for class complements.
813-
814802
class_count_ : array, shape (n_classes,)
815803
Number of samples encountered for each class during fitting. This
816804
value is weighted by the sample weight when provided.
817805
806+
class_log_prior_ : array, shape (n_classes, )
807+
Smoothed empirical log probability for each class. Only used in edge
808+
case with a single class in the training set.
809+
818810
classes_ : array, shape (n_classes,)
819811
Class labels known to the classifier
820-
812+
813+
feature_all_ : array, shape (n_features,)
814+
Number of samples encountered for each feature during fitting. This
815+
value is weighted by the sample weight when provided.
816+
821817
feature_count_ : array, shape (n_classes, n_features)
822818
Number of samples encountered for each (class, feature) during fitting.
823819
This value is weighted by the sample weight when provided.
824820
825-
n_features_ : int
826-
Number of features of each sample.
827-
828-
feature_all_ : array, shape (n_features,)
829-
Number of samples encountered for each feature during fitting. This
830-
value is weighted by the sample weight when provided.
821+
feature_log_prob_ : array, shape (n_classes, n_features)
822+
Empirical weights for class complements.
831823
832-
classes_ : array of shape (n_classes,)
833-
The classes labels.
824+
n_features_ : int
825+
Number of features of each sample.
834826
835827
Examples
836828
--------
@@ -919,29 +911,27 @@ class BernoulliNB(BaseDiscreteNB):
919911
920912
Attributes
921913
----------
922-
class_log_prior_ : array, shape = [n_classes]
923-
Log probability of each class (smoothed).
924-
925-
feature_log_prob_ : array, shape = [n_classes, n_features]
926-
Empirical log probability of features given a class, P(x_i|y).
927-
928914
class_count_ : array, shape = [n_classes]
929915
Number of samples encountered for each class during fitting. This
930916
value is weighted by the sample weight when provided.
917+
918+
class_log_prior_ : array, shape = [n_classes]
919+
Log probability of each class (smoothed).
931920
932921
classes_ : array, shape (n_classes,)
933922
Class labels known to the classifier
934-
923+
935924
feature_count_ : array, shape = [n_classes, n_features]
936925
Number of samples encountered for each (class, feature)
937926
during fitting. This value is weighted by the sample weight when
938927
provided.
928+
929+
feature_log_prob_ : array, shape = [n_classes, n_features]
930+
Empirical log probability of features given a class, P(x_i|y).
939931
940932
n_features_ : int
941933
Number of features of each sample.
942934
943-
classes_ : array of shape (n_classes,)
944-
The classes labels.
945935
946936
Examples
947937
--------
@@ -1045,23 +1035,26 @@ class CategoricalNB(BaseDiscreteNB):
10451035
10461036
Attributes
10471037
----------
1048-
class_log_prior_ : array, shape (n_classes, )
1049-
Smoothed empirical log probability for each class.
1050-
1051-
feature_log_prob_ : list of arrays, len n_features
1038+
category_count_ : list of arrays, len n_features
10521039
Holds arrays of shape (n_classes, n_categories of respective feature)
1053-
for each feature. Each array provides the empirical log probability
1054-
of categories given the respective feature and class, ``P(x_i|y)``.
1040+
for each feature. Each array provides the number of samples
1041+
encountered for each class and category of the specific feature.
10551042
10561043
class_count_ : array, shape (n_classes,)
10571044
Number of samples encountered for each class during fitting. This
10581045
value is weighted by the sample weight when provided.
1046+
1047+
class_log_prior_ : array, shape (n_classes, )
1048+
Smoothed empirical log probability for each class.
10591049
1060-
category_count_ : list of arrays, len n_features
1050+
classes_ : array, shape (n_classes,)
1051+
Class labels known to the classifier
1052+
1053+
feature_log_prob_ : list of arrays, len n_features
10611054
Holds arrays of shape (n_classes, n_categories of respective feature)
1062-
for each feature. Each array provides the number of samples
1063-
encountered for each class and category of the specific feature.
1064-
1055+
for each feature. Each array provides the empirical log probability
1056+
of categories given the respective feature and class, ``P(x_i|y)``.
1057+
10651058
n_features_ : int
10661059
Number of features of each sample.
10671060

0 commit comments

Comments
 (0)
0