Skip to content

[MRG] Deprecate random_state in OneClassSVM and add clarifications in docstrings and doc #9703

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 6 commits into from
Sep 7, 2017

Conversation

albertcthomas
Copy link
Contributor

Reference Issue

Fixes issue #9497

What does this implement/fix? Explain your changes.

This deprecates random_state in OneClassSVM as OneClassSVM is not random and does not provide probability estimation. This also clarifies the docstrings of random_state in SVC, NuSVC and LinearSVC and adds information about the randomness of the underlying implementations of these estimators in the User Guide.

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 the dual coordinate descent (if ``dual=True``). If int,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is not used with dual=False?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I saw the sentence above. Please add here too:

When ``dual=False`` the underlying implementation is
 not random and ``random_state`` has no effect on the results.

``probability`` is set to ``True``). This randomness can be controlled
with the ``random_state`` parameter. If ``probability`` is set to ``False``
these estimators are not random and ``random_state`` has no effect on the
results. The underlying :class:`OneClassSVM` implementation is similar to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two spaces before "The underlying..."

@agramfort
Copy link
Member

besides LGTM

@@ -1025,6 +1026,10 @@ class OneClassSVM(BaseLibSVM):
generator; If None, the random number generator is the RandomState
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this docstring should be changed to ignored. Unlike other deprecated parameters, it actually has no effect.

@albertcthomas
Copy link
Contributor Author

thanks for the reviews and comments @agramfort and @jnothman

@jnothman
Copy link
Member

jnothman commented Sep 7, 2017

I suppose you'd better add an entry to what's new.

@jnothman jnothman merged commit 48afa9d into scikit-learn:master Sep 7, 2017
@albertcthomas albertcthomas deleted the svm_random_state branch September 15, 2017 12:53
massich pushed a commit to massich/scikit-learn that referenced this pull request Sep 15, 2017
maskani-moh pushed a commit to maskani-moh/scikit-learn that referenced this pull request Nov 15, 2017
jwjohnson314 pushed a commit to jwjohnson314/scikit-learn that referenced this pull request Dec 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants