From a507d83329700113185c6d6d779251fcd29a1f68 Mon Sep 17 00:00:00 2001 From: DatenBiene Date: Thu, 30 Jan 2020 15:12:06 +0100 Subject: [PATCH 1/3] Update svm random_state doc --- sklearn/svm/_base.py | 7 +++---- sklearn/svm/_classes.py | 29 ++++++++++++----------------- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/sklearn/svm/_base.py b/sklearn/svm/_base.py index ea9b52ba4ef89..40526fcc9b7d4 100644 --- a/sklearn/svm/_base.py +++ b/sklearn/svm/_base.py @@ -862,10 +862,9 @@ def _fit_liblinear(X, y, C, fit_intercept, intercept_scaling, class_weight, random_state : int or RandomState instance, default=None The seed of the pseudo random number generator to use when shuffling - the data. If int, random_state is the seed used by the random number - generator; If RandomState instance, random_state is the random number - generator; If None, the random number generator is the RandomState - instance used by `np.random`. + the data. + Pass an int for reproducible output across multiple function calls. + See :term:`Glossary `. multi_class : {'ovr', 'crammer_singer'}, default='ovr' `ovr` trains n_classes one-vs-rest classifiers, while `crammer_singer` diff --git a/sklearn/svm/_classes.py b/sklearn/svm/_classes.py index d21e8523cac2c..ce2ca875fdd65 100644 --- a/sklearn/svm/_classes.py +++ b/sklearn/svm/_classes.py @@ -92,11 +92,9 @@ class LinearSVC(BaseEstimator, LinearClassifierMixin, The seed of the pseudo random number generator to use when shuffling the data for the dual coordinate descent (if ``dual=True``). When ``dual=False`` the underlying implementation of :class:`LinearSVC` - is not random and ``random_state`` has no effect on the results. If - int, random_state is the seed used by the random number generator; If - RandomState instance, random_state is the random number generator; If - None, the random number generator is the RandomState instance used by - `np.random`. + is not random and ``random_state`` has no effect on the results. + Pass an int for reproducible output across multiple function calls. + See :term:`Glossary `. max_iter : int, default=1000 The maximum number of iterations to be run. @@ -301,10 +299,9 @@ class LinearSVR(RegressorMixin, LinearModel): random_state : int or RandomState instance, default=None The seed of the pseudo random number generator to use when shuffling - the data. If int, random_state is the seed used by the random number - generator; If RandomState instance, random_state is the random number - generator; If None, the random number generator is the RandomState - instance used by `np.random`. + the data. + Pass an int for reproducible output across multiple function calls. + See :term:`Glossary `. max_iter : int, default=1000 The maximum number of iterations to be run. @@ -523,10 +520,9 @@ class SVC(BaseSVC): random_state : int or RandomState instance, default=None The seed of the pseudo random number generator used when shuffling - the data for probability estimates. If int, random_state is the - seed used by the random number generator; If RandomState instance, - random_state is the random number generator; If None, the random - number generator is the RandomState instance used by `np.random`. + the data for probability estimates. + Pass an int for reproducible output across multiple function calls. + See :term:`Glossary `. Attributes ---------- @@ -729,10 +725,9 @@ class NuSVC(BaseSVC): random_state : int or RandomState instance, default=None The seed of the pseudo random number generator used when shuffling - the data for probability estimates. If int, random_state is the seed - used by the random number generator; If RandomState instance, - random_state is the random number generator; If None, the random - number generator is the RandomState instance used by `np.random`. + the data for probability estimates. + Pass an int for reproducible output across multiple function calls. + See :term:`Glossary `. Attributes ---------- From 932c600ba20a9525d7c9f887a98fd89de079142c Mon Sep 17 00:00:00 2001 From: DatenBiene Date: Thu, 30 Jan 2020 17:49:02 +0100 Subject: [PATCH 2/3] Update doc --- sklearn/svm/_base.py | 4 ++-- sklearn/svm/_classes.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sklearn/svm/_base.py b/sklearn/svm/_base.py index 40526fcc9b7d4..15e6d9aaf399f 100644 --- a/sklearn/svm/_base.py +++ b/sklearn/svm/_base.py @@ -861,8 +861,8 @@ def _fit_liblinear(X, y, C, fit_intercept, intercept_scaling, class_weight, Stopping condition. random_state : int or RandomState instance, default=None - The seed of the pseudo random number generator to use when shuffling - the data. + Controls the pseudo random number generator to use when shuffling the + data. Pass an int for reproducible output across multiple function calls. See :term:`Glossary `. diff --git a/sklearn/svm/_classes.py b/sklearn/svm/_classes.py index ce2ca875fdd65..9a30acc018334 100644 --- a/sklearn/svm/_classes.py +++ b/sklearn/svm/_classes.py @@ -89,7 +89,7 @@ class LinearSVC(BaseEstimator, LinearClassifierMixin, properly in a multithreaded context. random_state : int or RandomState instance, default=None - The seed of the pseudo random number generator to use when shuffling + Controls the pseudo random number generator to use when shuffling the data for the dual coordinate descent (if ``dual=True``). When ``dual=False`` the underlying implementation of :class:`LinearSVC` is not random and ``random_state`` has no effect on the results. @@ -298,8 +298,8 @@ class LinearSVR(RegressorMixin, LinearModel): properly in a multithreaded context. random_state : int or RandomState instance, default=None - The seed of the pseudo random number generator to use when shuffling - the data. + Controls the pseudo random number generator to use when shuffling the + data. Pass an int for reproducible output across multiple function calls. See :term:`Glossary `. @@ -519,7 +519,7 @@ class SVC(BaseSVC): .. versionadded:: 0.22 random_state : int or RandomState instance, default=None - The seed of the pseudo random number generator used when shuffling + Controls the pseudo random number generator used when shuffling the data for probability estimates. Pass an int for reproducible output across multiple function calls. See :term:`Glossary `. @@ -724,7 +724,7 @@ class NuSVC(BaseSVC): .. versionadded:: 0.22 random_state : int or RandomState instance, default=None - The seed of the pseudo random number generator used when shuffling + Controls the pseudo random number generator used when shuffling the data for probability estimates. Pass an int for reproducible output across multiple function calls. See :term:`Glossary `. From 424d58947905acf80a4e796c9709ee16562cf388 Mon Sep 17 00:00:00 2001 From: DatenBiene Date: Fri, 31 Jan 2020 14:36:31 +0100 Subject: [PATCH 3/3] Update svm random_state doc --- sklearn/svm/_base.py | 3 +-- sklearn/svm/_classes.py | 19 +++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/sklearn/svm/_base.py b/sklearn/svm/_base.py index 15e6d9aaf399f..16e482a177ee9 100644 --- a/sklearn/svm/_base.py +++ b/sklearn/svm/_base.py @@ -861,8 +861,7 @@ def _fit_liblinear(X, y, C, fit_intercept, intercept_scaling, class_weight, Stopping condition. random_state : int or RandomState instance, default=None - Controls the pseudo random number generator to use when shuffling the - data. + Controls the pseudo random number generation for shuffling the data. Pass an int for reproducible output across multiple function calls. See :term:`Glossary `. diff --git a/sklearn/svm/_classes.py b/sklearn/svm/_classes.py index 9a30acc018334..0750e5a4c1ae2 100644 --- a/sklearn/svm/_classes.py +++ b/sklearn/svm/_classes.py @@ -89,10 +89,10 @@ class LinearSVC(BaseEstimator, LinearClassifierMixin, properly in a multithreaded context. random_state : int or RandomState instance, default=None - Controls the pseudo random number generator to use when shuffling - the data for the dual coordinate descent (if ``dual=True``). When - ``dual=False`` the underlying implementation of :class:`LinearSVC` - is not random and ``random_state`` has no effect on the results. + Controls the pseudo random number generation for shuffling the data for + the dual coordinate descent (if ``dual=True``). When ``dual=False`` the + underlying implementation of :class:`LinearSVC` is not random and + ``random_state`` has no effect on the results. Pass an int for reproducible output across multiple function calls. See :term:`Glossary `. @@ -298,8 +298,7 @@ class LinearSVR(RegressorMixin, LinearModel): properly in a multithreaded context. random_state : int or RandomState instance, default=None - Controls the pseudo random number generator to use when shuffling the - data. + Controls the pseudo random number generation for shuffling the data. Pass an int for reproducible output across multiple function calls. See :term:`Glossary `. @@ -519,8 +518,8 @@ class SVC(BaseSVC): .. versionadded:: 0.22 random_state : int or RandomState instance, default=None - Controls the pseudo random number generator used when shuffling - the data for probability estimates. + Controls the pseudo random number generation for shuffling the data for + probability estimates. Pass an int for reproducible output across multiple function calls. See :term:`Glossary `. @@ -724,8 +723,8 @@ class NuSVC(BaseSVC): .. versionadded:: 0.22 random_state : int or RandomState instance, default=None - Controls the pseudo random number generator used when shuffling - the data for probability estimates. + Controls the pseudo random number generation for shuffling the data for + probability estimates. Pass an int for reproducible output across multiple function calls. See :term:`Glossary `.