-
-
Notifications
You must be signed in to change notification settings - Fork 26.5k
FIX Treat gradient boosting categoricals outside the bounds as unknown during predict #24283
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
FIX Treat gradient boosting categoricals outside the bounds as unknown during predict #24283
Conversation
Micky774
left a comment
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.
Minor suggestion for wording, otherwise looks good.
Regarding the test, would it be worthwhile to test against multiple unique negative values? I'm fine with it as it is now, but it wouldn't hurt.
Co-authored-by: Meekail Zain <[email protected]>
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.
Assuming CI failure is a fluke, LGTM
sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py
Outdated
Show resolved
Hide resolved
|
Looks good to me. Especially if you implement the open suggestion from Meekail ;) |
lorentzenchr
left a comment
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.
LGTM. Could you extend the docstrings of the estimator classes to document this behaviour?
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
Co-authored-by: Christian Lorentzen <[email protected]>
|
@Micky774 Do you want to give it a second look and an approval? In that case I'll merge. |
Micky774
left a comment
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.
LGTM (x2)!
Co-authored-by: Meekail Zain <[email protected]>
Co-authored-by: Meekail Zain <[email protected]>
Reference Issues/PRs
Fixes #24274
What does this implement/fix? Explain your changes.
This PR checks considers negative categorical input as unknown during predict.
Any other comments?
The alternative is to error, but I think the check is simple enough to support.