Skip to content

ENH Raise NotFittedError in get_feature_names_out for Imputers and Isotonic Regression #25367

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

Merged
merged 9 commits into from
Jan 18, 2023

Conversation

rprkh
Copy link
Contributor

@rprkh rprkh commented Jan 12, 2023

Reference Issues/PRs

Towards #24916

What does this implement/fix? Explain your changes.

Includes check_is_fitted for the following Imputers:

  • Iterative Imputer
  • KNN Imputer
  • Simple Imputer

Also includes check_is_fitted for Isotonic Regression

Any other comments?

Test passes pytest -vsl sklearn/tests/test_common.py -k estimators_get_feature_names_out_error

@glemaitre glemaitre self-requested a review January 13, 2023 21:38
@@ -41,7 +41,11 @@ Changes impacting all modules
raises a `NotFittedError` if the instance is not fitted. This ensures the error is
consistent in all estimators with the `get_feature_names_out` method.

- :class:`feature_extraction.text.TfidfTransformer`
Copy link
Member

Choose a reason for hiding this comment

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

I reordered those to be in alphabetic order.

Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @rprkh

@rprkh
Copy link
Contributor Author

rprkh commented Jan 18, 2023

Extended this PR to include isotonic regression based on #24916 (comment)

@rprkh rprkh changed the title ENH Raise NotFittedError in get_feature_names_out for Imputers ENH Raise NotFittedError in get_feature_names_out for Imputers and Isotonic Regression Jan 18, 2023
Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

Thank you for the PR! LGTM

@thomasjpfan thomasjpfan merged commit 7c91462 into scikit-learn:main Jan 18, 2023
@rprkh rprkh deleted the enh_notfitted_imputers branch January 19, 2023 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants