[scikit-learn] Delegating "get_params" and "set_params" to a wrapped estimator when parameter is not defined.

Javier López jlopez at ende.cc
Mon Apr 16 09:33:08 EDT 2018


How could I make mixins work in this case?

If I define the class `FancyEstimatorMixin`, in order to get a drop-in
replacement for a sklearn
object wouldn't I need to monkey-patch the scikit-learn `BaseEstimator`
class to inherit from my mixin?
Or am I misunderstanding something?

(BTW monkey-patching is one of the things I am trying to avoid in a "clean"
solution)

On Mon, Apr 16, 2018 at 1:24 PM Manuel CASTEJÓN LIMAS via scikit-learn <
scikit-learn at python.org> wrote:

> Nope! Mostly because of lack of experience with mixins.
> I've done some reading and I think I can come up with a few mixins doing
> the trick by dynamically adding their methods to an already instantiated
> object. I'll play with that and I hope to show you something soon! Or at
> least I will have better grounds to make an educated decision.
> Best
> Manuel
>
> 2018-04-15 15:18 GMT+02:00 Joel Nothman <joel.nothman at gmail.com>:
>
>> Have you considered whether a mixin is a better model than a wrapper?​
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20180416/2071f30d/attachment.html>


More information about the scikit-learn mailing list