Skip to content

TST use global_random_seed in sklearn/ensemble/tests/test_iforest.py #22901

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 14 commits into from
May 18, 2022

Conversation

MaxwellLZH
Copy link
Contributor

Reference Issues/PRs

Related issue #22827.

What does this implement/fix? Explain your changes.

Adds global_random_seed to tests that are checking model precision or consistency.

The only tests that didn't work out-of-the box was test_iforest_performance which fails on a couple of seeds, so I increased sample size and made the outlier data a bit more obvious.

Copy link
Member

@jeremiedbb jeremiedbb left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @MaxwellLZH. Here are some suggestions

@jeremiedbb jeremiedbb added No Changelog Needed Quick Review For PRs that are quick to review labels Mar 28, 2022
Copy link
Member

@jeremiedbb jeremiedbb left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @MaxwellLZH

jeremiedbb added 2 commits May 4, 2022 15:30
test_iforest_sparse
test_iforest_parallel_regression
test_iforest_performance
@jeremiedbb
Copy link
Member

tested with all random seeds in commit 768d4f2

@glemaitre glemaitre self-requested a review May 6, 2022 13:04
Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

Otherwise, it looks good.

MaxwellLZH and others added 4 commits May 6, 2022 21:27
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
@ogrisel
Copy link
Member

ogrisel commented May 17, 2022

I pushed a new commit to also use the fixture in the test_iforest_chunks_works* tests and then re-triggered the [all random seeds] CI.

Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

Assuming CI will stay green with the last commits, LGTM.

test_iforest_sparse
test_iforest_parallel_regression
test_iforest_performance
test_iforest_chunks_works1
test_iforest_chunks_works2
@ogrisel ogrisel merged commit 6ca1f5e into scikit-learn:main May 18, 2022
lesteve pushed a commit to lesteve/scikit-learn that referenced this pull request May 19, 2022
…cikit-learn#22901)



Co-authored-by: jeremie du boisberranger <jeremiedbb@yahoo.fr>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants