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
FEA Add staged_predict to HistGradientBoosting #16985
FEA Add staged_predict to HistGradientBoosting #16985
Conversation
thanks for the PR @haochunchang , please ping me when you are ready to get reviews or if you need any help |
I have also checked with an example: test_staged_predict_example.txt (adopted from here). In short, I moved part of the original I wasn't sure whether the change is what I would be very appreciated for @NicolasHug or anyone who reviews this code and gives any directions for checking :) |
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 @haochunchang , it looks in good shape!
I made a few comments, mostly on the style.
Do you also want to add support for the classifier?
sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
Outdated
Show resolved
Hide resolved
sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
Outdated
Show resolved
Hide resolved
sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
Outdated
Show resolved
Hide resolved
sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
Outdated
Show resolved
Hide resolved
sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
Outdated
Show resolved
Hide resolved
hmm, use your best judgement. It'd be fine eitherway. Also note that we don't need the first one if you do the second |
11c3232
to
b921b3a
Compare
b921b3a
to
05cd4fc
Compare
For simplicity, I added only one test for testing staged_predict.
|
I would be very appreciated for @NicolasHug or anyone who reviews this code and gives any directions for checking :) |
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 for your patience @haochunchang , we've been busy with the release
This mostly looks good, I'd just suggest to also add staged_predict_proba and staged_decision_function which should be pretty easy now that you have it all laid out.
sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
Outdated
Show resolved
Hide resolved
sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
Outdated
Show resolved
Hide resolved
sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
Outdated
Show resolved
Hide resolved
sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
Outdated
Show resolved
Hide resolved
sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
Outdated
Show resolved
Hide resolved
2bfe890
to
700ba6e
Compare
Good effort for the release! @NicolasHug |
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 @haochunchang , almost there
sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
Outdated
Show resolved
Hide resolved
sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
Outdated
Show resolved
Hide resolved
sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
Outdated
Show resolved
Hide resolved
700ba6e
to
a20a7c8
Compare
sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
Outdated
Show resolved
Hide resolved
sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
Outdated
Show resolved
Hide resolved
a20a7c8
to
ae55f9b
Compare
sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
Outdated
Show resolved
Hide resolved
sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
Outdated
Show resolved
Hide resolved
sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
Outdated
Show resolved
Hide resolved
sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
Outdated
Show resolved
Hide resolved
ae55f9b
to
3bddc63
Compare
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 @haochunchang
maybe @amueller @thomasjpfan can review this one? |
sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
Outdated
Show resolved
Hide resolved
3bddc63
to
b76daa3
Compare
b76daa3
to
9d66d76
Compare
Thanks @haochunchang ! Sorry we forgot to mention earlier: we'll need a what's new entry: Please add an entry to the change log at You can take inspiration from the 0.23 what'snew if you need |
Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>
9d66d76
to
e9931e5
Compare
Thanks for the work and for your patience @haochunchang ! Just a side note for you next contributions: you don't need to force-push changes, we're always going to squash and merge anyway. When you force push it makes things a little bit harder for us if we have already checked-out your branch ;) |
Got it! |
Reference Issues/PRs
Try Fixes #16063
What does this implement/fix? Explain your changes.
Add staged_predict by emulating BaseGradientBoosting. Including private functions.
Any other comments?
This is my first PR for a feature request.
I would be very appreciated for any advices or collaborations.