project-template
project-template copied to clipboard
Add _OneToOneFeatureMixin to class templates
Scikit-learn recently updated all classes to have the get_feature_names_out
method in order to allow retrieving feature names from pipelines (https://github.com/scikit-learn/scikit-learn/issues/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?
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.