-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
OneHotEncoder throws unhelpful error messages when tranform called prior to fit #12395
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
Labels
Milestone
Comments
Thanks for the report. Do you want to work on a fix? |
Sure, I am happy to. |
Thanks! |
@dillongardner have you started working on this? We want to release a bugfix version relatively soon. |
A bit more nuanced than expected. Sorry for the delay. |
I a fixed list of categories are passed to the constructor maybe we could also not raise any exception at all as the estimator should be stateless in that case, no? |
I'm fine with not requiring fitting if categories is provided. (There's an
estimator tag for that!)
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
OneHotEncoder throws an
AttributeError
instead of aNotFittedError
when tranform is called prior to fittransform
is called prior to being fit anAttributeError
is throwncategories
includes arrays of of unicode typeSteps/Code to Reproduce
Expected Results
NotFittedError: This OneHotEncoder instance is not fitted yet. Call 'fit' with appropriate arguments before using this method.
Actual Results
Throws AttributeError: 'OneHotEncoder' object has no attribute '_legacy_mode'
Versions
The text was updated successfully, but these errors were encountered: