On 9/17/19 3:42 AM, Joel Nothman wrote:
I think you mean keyword-only, Alex

On Tue., 17 Sep. 2019, 4:11 pm Alexandre Gramfort, <alexandre.gramf...@inria.fr <mailto:alexandre.gramf...@inria.fr>> wrote:

    Yes I am +1 for positional arguments for the __init__ of the
    estimators.

    Alex



Albert: my position when reviewing changes in accordance with this SLEP would be to (a) perhaps get usage evidence as discussed in the SLEP pull request review; and (b) apply a rule of thumb like "are the semantics reasonably clear when the argument is passed positionally?" I think they are clear for PCA's components, for Pipeline's steps, and for GridSearchCV's estimator and parameter grid. Other parameters of those estimators seem more suitable for keyword-only.
I think you're not fully addressing Albert's concern, which I think is quite important and hasn't been brought up before.

I think Albert is saying that it should be easy for a new user to build a mental model of when a positional argument is allowed. If we can't specify a simple rule, then it's very hard for a new (or really any) user to have clear expectations.
And I think sklearn is all about setting clear expectations.

> Also how  is this going to be rendered by sphinx in the doc?

There will be a star in the signature between positional and kw only args i.e. PCA(n_components=2, *, copy=True, ...) So you could always look at the docs to figure it out. That's clearly not very convenient.


_______________________________________________
scikit-learn mailing list
scikit-learn@python.org
https://mail.python.org/mailman/listinfo/scikit-learn

Reply via email to