Skip to content

[DOC] Update random_state descriptions for SVMs #16316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions sklearn/svm/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,11 +861,9 @@ 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. 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`.
Controls the pseudo random number generation for shuffling the data.
Pass an int for reproducible output across multiple function calls.
See :term:`Glossary <random_state>`.

multi_class : {'ovr', 'crammer_singer'}, default='ovr'
`ovr` trains n_classes one-vs-rest classifiers, while `crammer_singer`
Expand Down
40 changes: 17 additions & 23 deletions sklearn/svm/_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,12 @@ 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
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`.
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 <random_state>`.

max_iter : int, default=1000
The maximum number of iterations to be run.
Expand Down Expand Up @@ -300,11 +298,9 @@ 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. 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`.
Controls the pseudo random number generation for shuffling the data.
Pass an int for reproducible output across multiple function calls.
See :term:`Glossary <random_state>`.

max_iter : int, default=1000
The maximum number of iterations to be run.
Expand Down Expand Up @@ -522,11 +518,10 @@ 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
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`.
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 <random_state>`.

Attributes
----------
Expand Down Expand Up @@ -728,11 +723,10 @@ 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
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`.
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 <random_state>`.

Attributes
----------
Expand Down