-
-
Notifications
You must be signed in to change notification settings - Fork 26k
MNT Uses a less strict error message for n_features_in_ checks #18585
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
@NicolasHug Are you okay with this change? |
I was thinking that having the estimator's name in the error message is useful precisely in the case of meta-estimators. No strong opinion anyway |
I am okay with this as well. Then we adjust the test: scikit-learn/sklearn/utils/estimator_checks.py Lines 3177 to 3178 in fdb9233
to accept any name for the class name? |
sure, this sounds good too |
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 if green!
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.
Ok let's do it this way for now and we can always be stricter later.
Reference Issues/PRs
Related to #18578 (comment)
What does this implement/fix? Explain your changes.
This PR updates the error message to not include the estimator name. This allows meta estimators to delegate to inner estimators and output a more generic error message.
Any other comments?
An alternative would be to catch the exception check its message and change the estimator name to the met estimator. This seems heavy handed.
CC @ogrisel