8000 Merge pull request #6853 from krishnakalyan3/class_weight_balance · scikit-learn/scikit-learn@a5176e5 · GitHub
[go: up one dir, main page]

Skip to content

Commit a5176e5

Browse files
committed
Merge pull request #6853 from krishnakalyan3/class_weight_balance
DOC Update residual references of class_weight as balanced
2 parents 9795916 + 6064327 commit a5176e5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

doc/modules/grid_search.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ For each parameter, either a distribution over possible values or a list of
101101
discrete choices (which will be sampled uniformly) can be specified::
102102

103103
[{'C': scipy.stats.expon(scale=100), 'gamma': scipy.stats.expon(scale=.1),
104-
'kernel': ['rbf'], 'class_weight':['auto', None]}]
104+
'kernel': ['rbf'], 'class_weight':['balanced', None]}]
105105

106106
This example uses the ``scipy.stats`` module, which contains many useful
107107
distributions for sampling parameters, such as ``expon``, ``gamma``,

sklearn/svm/classes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,12 +588,12 @@ class NuSVC(BaseSVC):
588588
cache_size : float, optional
589589
Specify the size of the kernel cache (in MB).
590590
591-
class_weight : {dict, 'auto'}, optional
591+
class_weight : {dict, 'balanced'}, optional
592592
Set the parameter C of class i to class_weight[i]*C for
593593
SVC. If not given, all classes are supposed to have
594-
weight one. The 'auto' mode uses the values of y to
595-
automatically adjust weights inversely proportional to
596-
class frequencies.
594+
weight one. The "balanced" mode uses the values of y to automatically adjust
595+
weights inversely proportional to class frequencies as
596+
``n_samples / (n_classes * np.bincount(y))``
597597
598598
verbose : bool, default: False
599599
Enable verbose output. Note that this setting takes advantage of a

0 commit comments

Comments
 (0)
0