-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
FIX remove n_estimators checks from validate_estimator #24224
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
Hi @naoise-h, thank you for your pull request. scikit-learn/sklearn/ensemble/tests/test_base.py Lines 61 to 70 in feaf382
is not failing in your PR.... do you mind investigating? Also, anyway the test should be modified accordingly with the new type of exception. Thanks! |
Thanks for pointing that out @cmarmo. It appears there is duplication in checking scikit-learn/sklearn/utils/_param_validation.py Lines 94 to 97 in feaf382
That leaves two questions:
|
Thanks for digging in! I'm afraid I'm not the right person to ask for an answer... I'm going to reference here #23462 as it is clearly related to parameter validation and label your PR accordingly. Hope this will help to give you a quick review. |
Hey there @naoise-h, thanks for bringing this up, and good catch @cmarmo on the related test. All base estimators which inherit form
currently have a parameter constraint for scikit-learn/sklearn/ensemble/_base.py Lines 135 to 147 in 8863eda
|
BaseEnsemble._validate_estimator
Co-authored-by: Meekail Zain <34613774+Micky774@users.noreply.github.com>
@thomasjpfan You may be interested in reviewing this |
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.
…mator (scikit-learn#24224) Co-authored-by: Meekail Zain <34613774+Micky774@users.noreply.github.com> Co-authored-by: jeremie du boisberranger <jeremiedbb@yahoo.fr>
What does this implement/fix? Explain your changes.
BaseEnsemble._validate_estimator
currently checks the type and value of the class'sn_estimators
parameter, despite it already being checked as part ofvalidate_parameter_constraints
. This PR removes the redundant check in_validate_estimator
.Any other comments?
Cf. #7457 and #7146 (old issue/PR)