-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
TST Accelerating ensemble/tests/test_voting.py::test_gridsearch #21422
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
TST Accelerating ensemble/tests/test_voting.py::test_gridsearch #21422
Conversation
@@ -263,7 +263,7 @@ def test_multilabel(): | |||
def test_gridsearch(): | |||
"""Check GridSearch support.""" | |||
clf1 = LogisticRegression(random_state=1) | |||
clf2 = RandomForestClassifier(random_state=1) | |||
clf2 = RandomForestClassifier(random_state=1, n_estimators=3) |
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.
If it's still slow, we could set max_depth=3
to make it run even faster.
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.
If it's still slow, we could set
max_depth=3
to make it run even faster.
@ogrisel the test case is not part of the 20 slowest anymore.
We tried max_depth=3
locally, but it didn't result in a visible speedup; not sure why.
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.
did you measure the time? I think this should be enough and we should merge :)
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.
Yes we did measure the time (for each test impl we ran the test 3 times); the average running time is reported below:
- original impl: 5.3 seconds
- ogrisel recommended changes: 0.57 seconds
- after adding
max_depth=3
: 0.59 seconds
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.
Thanks @mohaseeb!
and @erodrago! |
Reference Issues/PRs
Towards #21407
What does this implement/fix? Explain your changes.
These changes are accelerating test case
ensemble/tests/test_voting.py::test_gridsearch
Any other comments?
Programming partner: @erodrago
#DataUmbrella Sprint