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 HistGradientBoosting raising ValueError with monotonic_cst and categorical_feature #28925
Conversation
Thanks for the PR @yuanx749, the fix and the test look good. Can you please add an entry to the change log ( |
Thank you for reviewing @ogrisel. I added the entry to whats_new. |
Actually, I think it would be worth making the test stronger by expanding This way we could better check the correctness of the monotonicity constraint remapping. |
/cc @thomasjpfan. |
Good point. I updated Then I think the additional non-regression test I added before can be removed. |
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 the PR @yuanx749 ! The fix and additional tests looks good to me.
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.
Let's delete the redundant test but otherwise LGTM! Thanks for the fix.
Reference Issues/PRs
Fixes #28898
What does this implement/fix? Explain your changes.
HistGradientBoosting
usesColumnTransformer
to preprocess the input X, which places the categorical features at the beginning of X. This PR adjusts the feature order inmonotonic_cst
correspondingly, to avoid the error when callingTreeGrower
.Any other comments?