question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add specific tags for Search and Ensemble classes (and maybe Transformers)

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
gioxc88commented, Oct 30, 2020

I don’t think tags will solve your issue: third party developers would still need to use / set those tags in some way, the same way they should / would use the current scikit-learn Mixins / base classes.

In other words, just because the tag exists in sklearn doesn’t mean that HyperbandSearchCV would have its tag set to the proper value.

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 to BaseSearchCV and BaseEnsemble.

0reactions
NicolasHugcommented, Oct 30, 2020

Since the original comment was addressed I’ll close the issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pretrained Transformers for Text Ranking: BERT and Beyond
The goal of text ranking is to generate an ordered list of texts retrieved from a corpus in response to a query for...
Read more >
Transformer-based ensemble method for multiple ...
If the instrument information is included in the tags, it allows people to search for music with the specific instrument they want.
Read more >
Chapter 4. Text Vectorization and Transformation Pipelines
In this chapter, we will demonstrate how to use the vectorization process to combine linguistic techniques from NLTK with machine learning techniques in...
Read more >
naiveHobo/HoboBERT: Ensemble of 10 modified ... - GitHub
Ensemble of 10 modified BERT Base models for prediction of best answers for queries on search engines. Implementation. The first implementation of HoboBERT...
Read more >
how to use ColumnTransformer() to return a dataframe?
Columns of the original feature matrix that are not specified are dropped from the resulting transformed feature matrix, unless specified in the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found