diff --git a/doc/modules/grid_search.rst b/doc/modules/grid_search.rst index de66f8bc02906..cdade7dd2f311 100644 --- a/doc/modules/grid_search.rst +++ b/doc/modules/grid_search.rst @@ -101,7 +101,7 @@ For each parameter, either a distribution over possible values or a list of discrete choices (which will be sampled uniformly) can be specified:: [{'C': scipy.stats.expon(scale=100), 'gamma': scipy.stats.expon(scale=.1), - 'kernel': ['rbf'], 'class_weight':['auto', None]}] + 'kernel': ['rbf'], 'class_weight':['balanced', None]}] This example uses the ``scipy.stats`` module, which contains many useful distributions for sampling parameters, such as ``expon``, ``gamma``, diff --git a/sklearn/svm/classes.py b/sklearn/svm/classes.py index 13f96b18041cb..cb3f542f6916b 100644 --- a/sklearn/svm/classes.py +++ b/sklearn/svm/classes.py @@ -588,12 +588,12 @@ class NuSVC(BaseSVC): cache_size : float, optional Specify the size of the kernel cache (in MB). - class_weight : {dict, 'auto'}, optional + class_weight : {dict, 'balanced'}, optional Set the parameter C of class i to class_weight[i]*C for SVC. If not given, all classes are supposed to have - weight one. The 'auto' mode uses the values of y to - automatically adjust weights inversely proportional to - class frequencies. + weight one. The "balanced" mode uses the values of y to automatically adjust + weights inversely proportional to class frequencies as + ``n_samples / (n_classes * np.bincount(y))`` verbose : bool, default: False Enable verbose output. Note that this setting takes advantage of a