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.

[FEATURE] Pass additional parameters to fit underlying estimator in `EstimatorTransformer`

See original GitHub issue

In EstimatorTransformer the underlying estimator is being fitted without the ability to pass along additional arguments to self.estimator_.fit.

This limits use cases for EstimatorTransformer. For example, if the underlying estimator is an XGBClassifier we would like to be able to pass eval_set to monitor validation performance and enable early stopping. This is currently not possible. Adding *args, **kwargs should fix this issue.

https://github.com/koaning/scikit-lego/blob/b4d087f0131ff164e6feebf238356ba6512b3635/sklego/meta/estimator_transformer.py#L31

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:14 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
koaningcommented, Sep 12, 2022

TIL.

Yeah so if scikit-learn supports **kwargs then I won’t mind.

1reaction
koaningcommented, Sep 13, 2022

Ah! Crud. My bad.

I was confused with the Grouped variant of the meta estimators. These come with a predictor variant.

Please ignore the previous comment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developing scikit-learn estimators
The fit() method takes the training data as arguments, which can be one array in the case of unsupervised learning, or two arrays...
Read more >
Developing custom scikit-learn transformers and estimators
Estimators have get_params and set_params functions. The get_params function takes no arguments and returns a dict of the __init__ parameters of ...
Read more >
Overview: estimators, transformers and pipelines - spark.ml
An Estimator abstracts the concept of a learning algorithm or any algorithm that fits or trains on data. Technically, an Estimator implements a...
Read more >
User guide: create your own scikit-learn estimator
Transformers are scikit-learn estimators which implement a transform method. The use case is the following: at fit , some parameters can be learned...
Read more >
Custom Transformer · Issue #391 · ageron/handson-ml - GitHub
In some cases, you may want to pass extra arguments to the fit() method. ... arguments through to the underlying estimator's fit() method....
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