Skip to content
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

[WIP] Catch deprecation warnings of random_state in svc tests #10222

Closed
wants to merge 2 commits into from

Conversation

FarahSaeed
Copy link
Contributor

Reference Issues/PRs

Reference Issue: #10158

Hi.. Regarding issue #10158, this PR is related to catching deprecation warnings of random_state in SVC tests.
I've found the following tests where the relevant deprecation warnings are raising.

def test_sparse_oneclasssvm():

In this PR, the above test is edited to catch deprecation warning.

As for now, I've kept this PR '[WIP]' as there is need to make sure wether random_state is not being used in \examples or \doc.

Catch deprecation warning of svc random_state in tests.
Copy link
Member

@jnothman jnothman left a comment

Choose a reason for hiding this comment

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

Thanks!

sp_clf = svm.OneClassSVM(kernel=kernel, random_state=0)
check_svm_model_equal(clf, sp_clf, *dataset)
with ignore_warnings(category=DeprecationWarning):
clf = svm.OneClassSVM(kernel=kernel, random_state=0)
Copy link
Member

Choose a reason for hiding this comment

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

nah. Just remove the use of random_state instead. It's never done anything, and the deprecation is checked elsewhere.

Removing 'random_state = 0'  while intializing OneClassSVM object. (This
doesn't have any effect on functionality)
@FarahSaeed
Copy link
Contributor Author

@jnothman Thanks for the advice. In recent commit, I've removed the random_state parameter. I would also look for its use in /doc and /examples.

@FarahSaeed
Copy link
Contributor Author

Let me open a new pull request. In this one, there are a lot of other changes as well which I did for syncing.

@FarahSaeed FarahSaeed closed this Dec 2, 2017
@FarahSaeed FarahSaeed deleted the feature branch December 2, 2017 06:04
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.

None yet

2 participants