Skip to content

Commit 3be8a23

Browse files
committed
ENH addressed @ogrisel's comments.
1 parent 6f9339a commit 3be8a23

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

sklearn/svm/tests/test_svm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ def test_auto_weight():
339339
from sklearn.utils import compute_class_weight
340340
X, y = iris.data[:, :2], iris.target
341341
unbalanced = np.delete(np.arange(y.size), np.where(y > 1)[0][::2])
342-
342+
343343
classes = np.unique(y[unbalanced])
344344
class_weights = compute_class_weight('auto', classes, y[unbalanced])
345345
assert_true(np.argmax(class_weights) == 2)

sklearn/utils/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,12 @@ def compute_class_weight(class_weight, classes, y):
353353
354354
Parameters
355355
----------
356-
class_weight : dict or 'auto'
356+
class_weight : dict, 'auto' or None
357357
If 'auto', class weights will be given inverse proportional
358358
to the frequency of the class in the data.
359359
If a dictionary is given, keys are classes and values
360360
are corresponding class weights.
361+
If None is given, the class weights will be uniform.
361362
classes : list
362363
List of the classes occuring in the data, as given by
363364
``np.unique(y_org)`` with ``y_org`` the original class labels.

0 commit comments

Comments
 (0)