Add specific tags for Search and Ensemble classes (and maybe Transformers)
See original GitHub issueI am using sklearn
classes extensively for a project.
I am wrapping all the classes to extend the basic sklearn
functionalities using class decorators.
I find very useful to have all the information extracted thanks to _get_tags
method and also to the _estimator_type
attribute which lets me customize the classes depending on some criteria.
I would have thought that this should be the case also for Ensemble
classes like BaggingRegressor
and Search
classes like GridSearchCV
.
At the moment I am using a trick to understand if a particular class is a Search
or Ensemble
but this might not work in the future.
For example for Search
classes I check if the instance has the estimator
attribute which worked so far even with other libraries which implement the sklearn
API like for example scikit-optimize
and its BayesianSearchCV
.
But I believe it would be useful for developers to add this information to the sklearn
API maybe using an additional tag in the base classes for Search
and Ensemble
i.e. BaseSearchCV
and BaseEnsemble
.
Mayne it can also help to have the tag in the Transformer
class to understand if it’s a transformer such that one doesn’t have to rely on the “unwritten” rule of checking if an instance it has the predict
method
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Thank you for the answer, I am well aware of this. My example in fact had the objective of emphasising what you said: it should be up to developers to use tags on inherit from the the relevant class.
My point was to deprecate inheriting from
MetaEstimatorMixin
and adding tags toBaseSearchCV
andBaseEnsemble
.Since the original comment was addressed I’ll close the issue