@@ -456,11 +456,13 @@ def logistic_regression_path(X, y, pos_class=None, Cs=10, fit_intercept=True,
456
456
is called repeatedly with the same data, as y is modified
457
457
along the path.
458
458
459
- class_weight : {dict, 'auto'}, optional
460
- Over-/undersamples the samples of each class according to the given
461
- weights. If not given, all classes are supposed to have weight one.
462
- The 'auto' mode selects weights inversely proportional to class
463
- frequencies in the training set.
459
+ class_weight : dict or 'balanced', optional
460
+ Weights associated with classes in the form ``{class_label: weight}``.
461
+ If not given, all classes are supposed to have weight one.
462
+
463
+ The "balanced" mode uses the values of y to automatically adjust
464
+ weights inversely proportional to class frequencies in the input data
465
+ as ``n_samples / (n_classes * np.bincount(y))``
464
466
465
467
dual : bool
466
468
Dual or primal formulation. Dual formulation is only implemented for
@@ -729,11 +731,13 @@ def _log_reg_scoring_path(X, y, train, test, pos_class=None, Cs=10,
729
731
tol : float
730
732
Tolerance for stopping criteria.
731
733
732
- class_weight : {dict, 'auto'}, optional
733
- Over-/undersamples the samples of each class according to the given
734
- weights. If not given, all classes are supposed to have weight one.
735
- The 'auto' mode selects weights inversely proportional to class
736
- frequencies in the training set.
734
+ class_weight : dict or 'balanced', optional
735
+ Weights associated with classes in the form ``{class_label: weight}``.
736
+ If not given, all classes are supposed to have weight one.
737
+
738
+ The "balanced" mode uses the values of y to automatically adjust
739
+ weights inversely proportional to class frequencies in the input data
740
+ as ``n_samples / (n_classes * np.bincount(y))``
737
741
738
742
verbose : int
739
743
For the liblinear and lbfgs solvers set verbose to any positive
@@ -897,11 +901,13 @@ class LogisticRegression(BaseEstimator, LinearClassifierMixin,
897
901
To lessen the effect of regularization on synthetic feature weight
898
902
(and therefore on the intercept) intercept_scaling has to be increased.
899
903
900
- class_weight : {dict, 'auto'}, optional
901
- Over-/undersamples the samples of each class according to the given
902
- weights. If not given, all classes are supposed to have weight one.
903
- The 'auto' mode selects weights inversely proportional to class
904
- frequencies in the training set.
904
+ class_weight : dict or 'balanced', optional
905
+ Weights associated with classes in the form ``{class_label: weight}``.
906
+ If not given, all classes are supposed to have weight one.
907
+
908
+ The "balanced" mode uses the values of y to automatically adjust
909
+ weights inversely proportional to class frequencies in the input data
910
+ as ``n_samples / (n_classes * np.bincount(y))``
905
911
906
912
max_iter : int
907
913
Useful only for the newton-cg and lbfgs solvers. Maximum number of
@@ -1147,11 +1153,13 @@ class LogisticRegressionCV(LogisticRegression, BaseEstimator,
1147
1153
Specifies if a constant (a.k.a. bias or intercept) should be
1148
1154
added the decision function.
1149
1155
1150
- class_weight : {dict, 'auto'}, optional
1151
- Over-/undersamples the samples of each class according to the given
1152
- weights. If not given, all classes are supposed to have weight one.
1153
- The 'auto' mode selects weights inversely proportional to class
1154
- frequencies in the training set.
1156
+ class_weight : dict or 'balanced', optional
1157
+ Weights associated with classes in the form ``{class_label: weight}``.
1158
+ If not given, all classes are supposed to have weight one.
1159
+
1160
+ The "balanced" mode uses the values of y to automatically adjust
1161
+ weights inversely proportional to class frequencies in the input data
1162
+ as ``n_samples / (n_classes * np.bincount(y))``
1155
1163
1156
1164
cv : integer or cross-validation generator
1157
1165
The default cross-validation generator used is Stratified K-Folds.
@@ -1182,11 +1190,13 @@ class LogisticRegressionCV(LogisticRegression, BaseEstimator,
1182
1190
max_iter : int, optional
1183
1191
Maximum number of iterations of the optimization algorithm.
1184
1192
1185
- class_weight : {dict, 'auto'}, optional
1186
- Over-/undersamples the samples of each class according to the given
1187
- weights. If not given, all classes are supposed to have weight one.
1188
- The 'auto' mode selects weights inversely proportional to class
1189
- frequencies in the training set.
1193
+ class_weight : dict or 'balanced', optional
1194
+ Weights associated with classes in the form ``{class_label: weight}``.
1195
+ If not given, all classes are supposed to have weight one.
1196
+
1197
+ The "balanced" mode uses the values of y to automatically adjust
1198
+ weights inversely proportional to class frequencies in the input data
1199
+ as ``n_samples / (n_classes * np.bincount(y))``
1190
1200
1191
1201
n_jobs : int, optional
1192
1202
Number of CPU cores used during the cross-validation loop. If given
0 commit comments