[scikit-learn] Vote on SLEP009: keyword only arguments

Adrin adrin.jalali at gmail.com
Wed Sep 11 09:38:09 EDT 2019


Hi,

I'm (mostly) the messenger, don't shoot me :P

It may help to summarize the SLEP:
1. This can be applied to all methods, not just __init__.
2. The SLEP doesn't say we have to apply it everywhere. It's mostly that it
lets us do that.
3. It doesn't make ALL inputs a keywords only argument. The common ones
such as X and y in fit(X, y) will stay as they are.
   Therefore clf.fit(X, y) will definitely be allowed.
4. Whether or not sample_weight should be keyword only or not in fit,
requires its own discussion, and the route of the discussion
   is defined in the SLEP.

In other words, if an input parameter is used as a positional argument less
frequently than X% of the time, then it can/should be
a keyword only argument. But the SLEP better defines these conditions.

I hope that clarifies it a little bit.

Adrin/

On Wed, Sep 11, 2019 at 3:23 PM Alexandre Gramfort <
alexandre.gramfort at inria.fr> wrote:

> hi,
>
> Adrin do you suggest this for everything or maybe just for __init__
> params of estimators
> and stuff that can come after X, y in fit eg sample_weights?
>
> would:
>
> clf.fit(X, y)
>
> still be allowed?
>
> Alex
> _______________________________________________
> scikit-learn mailing list
> scikit-learn at python.org
> https://mail.python.org/mailman/listinfo/scikit-learn
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20190911/e504e960/attachment.html>


More information about the scikit-learn mailing list