-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[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
Conversation
…ntation of SMO is not random and OneClassSVM does not provide probability estimates
… SVC, LinearSVC and OneClassSVM in the doc
sklearn/svm/classes.py
Outdated
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, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
doc/modules/svm.rst
Outdated
``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 |
There was a problem hiding this comment.
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..."
besides LGTM |
sklearn/svm/classes.py
Outdated
@@ -1025,6 +1026,10 @@ class OneClassSVM(BaseLibSVM): | |||
generator; If None, the random number generator is the RandomState |
There was a problem hiding this comment.
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.
thanks for the reviews and comments @agramfort and @jnothman |
I suppose you'd better add an entry to what's new. |
… docstrings and doc (scikit-learn#9703)
… docstrings and doc (scikit-learn#9703)
… docstrings and doc (scikit-learn#9703)
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.