10000 ENH Adds feature_names_out to stacking estimators by thomasjpfan · Pull Request #22695 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

ENH Adds feature_names_out to stacking estimators #22695

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

Conversation

thomasjpfan
Copy link
Member

Reference Issues/PRs

Towards #21308

What does this implement/fix? Explain your changes.

This PR adds get_feature_names_out to Stacking. The feature names uses the name of the estimator that generated the prediction.

Any other comments?

The test_transformers_get_feature_names_out common tests will run on these estimators because they define get_feature_names_out:

def _include_in_get_feature_names_out_check(transformer):
if hasattr(transformer, "get_feature_names_out"):
return True

@thomasjpfan thomasjpfan changed the title ENH Adds feature_names_out to stacking estiamtors ENH Adds feature_names_out to stacking estimators Mar 5, 2022
@thomasjpfan thomasjpfan added this to the 1.1 milestone Mar 5, 2022
Copy link
Member
@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Here are some comments below.

For information, I checked that StackingRegressor does not currently allow multi-target regression, even if the base regressors do.

If it were the case the code should be adjusted accordingly, or at least a new test should be added to check that it works as expected.

Copy link
Member
@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member
@jeremiedbb jeremiedbb 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 @thomasjpfan

@jeremiedbb jeremiedbb merged commit c2d0dcb into scikit-learn:main Mar 8, 2022
thomasjpfan added a commit to thomasjpfan/scikit-learn that referenced this pull request Mar 8, 2022
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Apr 6, 2022
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
0