ENH Add get_feature_names_out for ensemble module#21459
ENH Add get_feature_names_out for ensemble module#21459MaxwellLZH wants to merge 9 commits intoscikit-learn:mainfrom
Conversation
ogrisel
left a comment
There was a problem hiding this comment.
Here is a way to help you fix the broken CI but I think we should directly reuse _ClassNamePrefixFeaturesOutMixin for this module. See comments below for details:
sklearn/ensemble/_forest.py
Outdated
| return np.asarray( | ||
| [f"{class_name}{i}" for i in range(self.n_outputs_)], | ||
| dtype=object, | ||
| ) |
There was a problem hiding this comment.
Alternatively, you could merge the current main into this branch to reuse the _ClassNamePrefixFeaturesOutMixin mixin-class introduced in https://github.com/scikit-learn/scikit-learn/pull/21334/files#diff-ac9c452d8c660d2516089c8448596912c22417c7c690f079715593e61ef6ee0dR884
This would require you to set the private _n_features_out attribute at fit time.
There was a problem hiding this comment.
Hi @ogrisel , I've changed all of the classes to use _ClassNamePrefixFeaturesOutMixin as you suggested
|
@MaxwellLZH it seems that you have added a bunch of unwanted changes to this branch when merging |
This reverts commit 879ebd0.
|
This branch is still in an inconsistent state. Maybe start over in a new branch branched off of a recently updated |
|
closed. Reopen a new PR. |
Reference Issues/PRs
Part of #21308
What does this implement/fix? Explain your changes.
Implementing
get_feature_names_outforRandomForestEmbedding,VotingClassifier,VotingRegressor,StackingClassifierandStackingRegressor, with corresponding test cases.