10000 [MRG] accelerate plot_successive_halving_iterations.py example #21598 by sply88 · Pull Request #21612 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

[MRG] accelerate plot_successive_halving_iterations.py example #21598 #21612

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

sply88
Copy link
Contributor
@sply88 sply88 commented Nov 9, 2021

Speeds up ../examples/model_selection/plot_successive_halving_iterations.py (Issue #21598) by

  • reducing size of dataset (samples and features)
  • reducing n_estimators
  • reducing max_features

For me example runs in 5 sec now (previously plus 13).

Reducing number of samples also reduces number of iterations during search (now 5, previously 6). Final figure:
image

Original figure:
image

@sply88 sply88 changed the title [MRG] accelerate plot_successive_halving_iterations.py example #21598 accelerate plot_successive_halving_iterations.py example #21598 Nov 10, 2021
@adrinjalali adrinjalali mentioned this pull request Nov 10, 2021
41 tasks
@adrinjalali
Copy link
Member

@sply88 could you please paste both before and after outputs of the example

Your change is trigerring an issue in the doc build. The CI fails.

@sply88
Copy link
Contributor Author
sply88 commented Nov 11, 2021

Your change is trigerring an issue in the doc build. The CI fails.

Seems like ax = mean_scores.plot(legend=False, alpha=0.6) (which was there before) currently causes the example to fail during the doc build. Works in my local env but not in the container.
Not sure how to best approach this. Any hints?

@adrinjalali
Copy link
Member

@NicolasHug @rth could maybe help here?

Copy link
Member
@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

Syncing with upstream should fix the issue. I think it is related to #21607 and how numpy is being updated in the min-doc build when installing the latest version of PyWavelets

@sply88
Copy link
Contributor Author
sply88 commented Nov 27, 2021

Syncing with upstream should fix the issue. I think it is related to #21607 and how numpy is being updated in the min-doc build when installing the latest version of PyWavelets

Works. Thanks for pointing that out @thomasjpfan

@sply88 sply88 changed the title accelerate plot_successive_halving_iterations.py example #21598 [MRG] accelerate plot_successive_halving_iterations.py example #21598 Nov 27, 2021

clf = RandomForestClassifier(n_estimators=20, random_state=rng)
clf = RandomForestClassifier(n_estimators=15, random_state=rng)
Copy link
Member

Choose a reason for hiding this comment

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

Can we leave this at 20? I like how the last iteration shows a difference between the last two candidates:

Figure_1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, result looks better with a unique winner. Only takes around 1s more on my machine. Thanks again for fine tuning!

Copy link
Member
@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

LGTM

@adrinjalali adrinjalali merged commit 64d2fdb into scikit-learn:main Nov 29, 2021
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Nov 29, 2021
…earn#21598 (scikit-learn#21612)

* accelerate plot_successive_halving_iterations.py example scikit-learn#21598

* n_estimators back to 20
samronsin pushed a commit to samronsin/scikit-learn that referenced this pull request Nov 30, 2021
…earn#21598 (scikit-learn#21612)

* accelerate plot_successive_halving_iterations.py example scikit-learn#21598

* n_estimators back to 20
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Dec 24, 2021
…earn#21598 (scikit-learn#21612)

* accelerate plot_successive_halving_iterations.py example scikit-learn#21598

* n_estimators back to 20
glemaitre pushed a commit that referenced this pull request Dec 25, 2021
…21612)

* accelerate plot_successive_halving_iterations.py example #21598

* n_estimators back to 20
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
0