Skip to content

API make __init__ args in ensemble kwonly#16724

Merged
jnothman merged 5 commits intoscikit-learn:masterfrom
adrinjalali:kwargs/ensemble
Mar 31, 2020
Merged

API make __init__ args in ensemble kwonly#16724
jnothman merged 5 commits intoscikit-learn:masterfrom
adrinjalali:kwargs/ensemble

Conversation

@adrinjalali
Copy link
Copy Markdown
Member

towards #15005

tackles the ensemble module

Copy link
Copy Markdown
Member

@jnothman jnothman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit trickier :)

I'm okay with this, but some of your decisions are more conservative than those I might have taken.

@adrinjalali
Copy link
Copy Markdown
Member Author

@jnothman does it look better now?


@abstractmethod
def __init__(self, estimators, final_estimator=None, cv=None,
def __init__(self, estimators, *, final_estimator=None, cv=None,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

final_estimator should always be supplied, right? The default seems like a fallback, not sure why we even have it. Not a strong opinion though.

Copy link
Copy Markdown
Member

@amueller amueller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. I would allow positional final_estimator but either is fine with me.

@adrinjalali
Copy link
Copy Markdown
Member Author

@amueller allowing positional final_estimator now. To me it's much more clear if the user writes Stacking(estimators, final_estimator=LogisticRegression()), but no strong feelings.

@jnothman
Copy link
Copy Markdown
Member

jnothman commented Mar 31, 2020 via email

@jnothman jnothman merged commit 97a6b08 into scikit-learn:master Mar 31, 2020
@adrinjalali adrinjalali deleted the kwargs/ensemble branch April 27, 2020 18:32
gio8tisu pushed a commit to gio8tisu/scikit-learn that referenced this pull request May 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants