-
-
Notifications
You must be signed in to change notification settings - Fork 26k
MAINT Use check_scalar in BaseGradientBoosting #21632
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
MAINT Use check_scalar in BaseGradientBoosting #21632
Conversation
Notes for parameter ranges in Trees |
…nto BaseGradientBoosting_add_check_scalar
Hi @glemaitre: just want to note that for the 7 remaining params in the PR task list (and also max_features), the validation is coming from I have added tests for these params in For these remaining params, please let me know if it would be helpful to include the validation explicitly within |
…nto BaseGradientBoosting_add_check_scalar
Hi @glemaitre and @ogrisel, please review this at you convenience. Thank you! |
Co-authored-by: Guillaume Lemaitre <[email protected]>
Co-authored-by: Guillaume Lemaitre <[email protected]>
Co-authored-by: Guillaume Lemaitre <[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.
LGTM
Co-authored-by: Guillaume Lemaitre <[email protected]>
sklearn/ensemble/_gb.py
Outdated
max_val=self.n_features_in_, | ||
include_boundaries="both", | ||
) |
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.
max_val=self.n_features_in_, | |
include_boundaries="both", | |
) | |
include_boundaries="left", | |
) |
Co-authored-by: Thomas J. Fan <[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.
LGTM
Co-authored-by: Guillaume Lemaitre <[email protected]> Co-authored-by: Thomas J. Fan <[email protected]>
Co-authored-by: Guillaume Lemaitre <[email protected]> Co-authored-by: Thomas J. Fan <[email protected]>
Reference Issues/PRs
This PR requires #21990 to be merged in first.
Addresses #20724 and #21927
#DataUmbrella
What does this implement/fix? Explain your changes.
Summary of changes to
BaseGradientBoosting
:GradientBoostingClassifier
andGradientBoostingRegressor
raise proper errors when invalid arguments are passed in.
check_scalar
fromsklearn.utils
to validate the scalar parameters.Test and validation progress:
In both estimators
In GradientBoostingRegressor
References
Any other comments?
For the unchecked tasks, validation is coming from
BaseDecisionTree
, however, tests have been added for them here.