Skip to content
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

Add _OneToOneFeatureMixin to class templates #74

Open
klapo opened this issue Jul 8, 2022 · 1 comment
Open

Add _OneToOneFeatureMixin to class templates #74

klapo opened this issue Jul 8, 2022 · 1 comment

Comments

@klapo
Copy link

klapo commented Jul 8, 2022

Scikit-learn recently updated all classes to have the get_feature_names_out method in order to allow retrieving feature names from pipelines (scikit-learn/scikit-learn#21308). The templates could be updated to reflect this new "template".

I believe it is just as simple as add _OneToOneFeatureMixin to each class. e.g.

from sklearn.base import BaseEstimator, ClassifierMixin, TransformerMixin, _OneToOneFeatureMixin

and

class TemplateEstimator(BaseEstimator, _OneToOneFeatureMixin):

What do you think?

@glemaitre
Copy link
Member

We could revisit a bit the documentation but I think that the details are already available in scikit-learn: https://scikit-learn.org/dev/developers/develop.html#developer-api-for-set-output

So we might improve the documentation to refer to that page.

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

No branches or pull requests

2 participants