8000 MNT accelerate plot_gradient_boosting_early_stopping.py example by sply88 · Pull Request #21609 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

MNT accelerate plot_gradient_boosting_early_stopping.py example #21609

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/ensemble/plot_gradient_boosting_early_stopping.py (Issue #21598) by

  • restricting digits dataset labels to 5 classes
  • restricting number of samples to 6000 for make_hastie_10_2
  • reducing n_estimators to 200

On my laptop example now takes sub 11 seconds (previously plus 50).

Main points (almost same accuracy and significant reduction of training time) are still very obvious in the plots:
image
image

@adrinjalali adrinjalali mentioned this pull request Nov 10, 2021
41 tasks
@adrinjalali
Copy link
Member

Here too, please paste both before and after plots, to make the reviews faster and more fluent.

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

Sure. After plots are in original description on top. Before plots look like this:
image
image

@adrinjalali
Copy link
Member

Could you try replacing the digits dataset with a synthetic dataset (make_classification) and see if it gets much faster?

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

Done. Have also reduces sample size for Hastie data a bit more. Time is down to 4s.

Output for last commit looks like this:
image
image

@adrinjalali adrinjalali changed the title [MRG] accelerate plot_gradient_boosting_early_stopping.py example #21598 [MRG] accelerate plot_gradient_boosting_early_stopping.py example Nov 23, 2021
Copy link
Member
@adrinjalali adrinjalali 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 @sply88.

@glemaitre WDYT? It makes a 48s example a 2s example.

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.

Thank you for the PR @sply88 !

sply88 and others added 2 commits November 27, 2021 20:08
Makes example results deterministic.

Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
@thomasjpfan thomasjpfan changed the title [MRG] accelerate plot_gradient_boosting_early_stopping.py example EXA accelerate plot_gradient_boosting_early_stopping.py example Nov 27, 2021
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

@thomasjpfan thomasjpfan changed the title EXA accelerate plot_gradient_boosting_early_stopping.py example MNT accelerate plot_gradient_boosting_early_stopping.py example Nov 27, 2021
@thomasjpfan thomasjpfan merged commit 832513a into scikit-learn:main Nov 27, 2021
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Nov 29, 2021
samronsin pushed a commit to samronsin/scikit-learn that referenced this pull request Nov 30, 2021
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Dec 24, 2021
glemaitre pushed a commit that referenced this pull request Dec 25, 2021
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
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