Skip to content

ENH Raise NotFittedError in get_feature_names_out for estimators that use OnetoOneFeatureMixin #25268

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

jpangas
Copy link
Contributor

@jpangas jpangas commented Jan 1, 2023

Reference Issues/PRs

In issue #24916, we want to make the error message uniform in estimators when we call get_feature_names_out before fit. This PR works towards that issue and solves the inconsistencies in estimators that inherit from the OnetoOneFeatureMixin Class.

What does this implement/fix? Explain your changes.

The following estimators that inherit from the OnetoOneFeatureMixin class will raise the agreed NotFittedError when get_feature_names_out is called before fit.

  • Binarizer
  • MaxAbsScaler
  • MinMaxScaler
  • Normalizer
  • OrdinalEncoder
  • PowerTransformer
  • QuantileTransformer
  • RobustScaler
  • StandardScaler
  • TfidfTransformer

Any other comments?

All tests successfully passed after the above estimators were removed from the whitelist.

@jpangas jpangas changed the title Fix error type in get_feature_names_out for estimators that use OnetoOneFeatureMixin Fix error type in get_feature_names_out for estimators that use OnetoOneFeatureMixin Jan 1, 2023
@jpangas jpangas changed the title Fix error type in get_feature_names_out for estimators that use OnetoOneFeatureMixin Fix error type in get_feature_names_out for estimators that use OnetoOneFeatureMixin Jan 1, 2023
@jpangas jpangas changed the title Fix error type in get_feature_names_out for estimators that use OnetoOneFeatureMixin ENH error type in get_feature_names_out for estimators that use OnetoOneFeatureMixin Jan 1, 2023
@jpangas jpangas changed the title ENH error type in get_feature_names_out for estimators that use OnetoOneFeatureMixin ENH Raise NotFittedError in get_feature_names_out for estimators that use OnetoOneFeatureMixin Jan 1, 2023
@jpangas
Copy link
Contributor Author

jpangas commented Jan 2, 2023

Let me know if I should make a changelog entry.

Copy link
Member

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have one changelog entry for all estimators, with a list of the fixed ones, rather than an entry for each estimator/module. Otherwise LGTM.

Please add something to the changelog, and future PRs should update that one.

@jpangas jpangas closed this Jan 4, 2023
@jpangas jpangas force-pushed the fix_get_feature_names_out_error_one_to_one_mixin branch from 71efdb4 to 62a017e Compare January 4, 2023 22:30
@jpangas jpangas deleted the fix_get_feature_names_out_error_one_to_one_mixin branch January 5, 2023 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants