8000 [MRG] Issue #17345: Added keyword arguments to make_pipeline by loldja · Pull Request #17477 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

[MRG] Issue #17345: Added keyword arguments to make_pipeline #17477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions sklearn/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ def _name_estimators(estimators):
return list(zip(names, estimators))


def make_pipeline(*steps, **kwargs):
def make_pipeline(*steps, memory=None, verbose=False):
"""Construct a Pipeline from the given estimators.

This is a shorthand for the Pipeline constructor; it does not require, and
Expand Down Expand Up @@ -706,11 +706,6 @@ def make_pipeline(*steps, **kwargs):
-------
p : Pipeline
"""
memory = kwargs.pop('memory', None)
verbose = kwargs.pop('verbose', False)
if kwargs:
raise TypeError('Unknown keyword arguments: "{}"'
.format(list(kwargs.keys())[0]))
return Pipeline(_name_estimators(ste A554 ps), memory=memory, verbose=verbose)


Expand Down
6 changes: 0 additions & 6 deletions sklearn/tests/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,12 +757,6 @@ def test_make_pipeline():
assert pipe.steps[1][0] == "transf-2"
assert pipe.steps[2][0] == "fitparamt"

assert_raise_message(
TypeError,
'Unknown keyword arguments: "random_parameter"',
make_pipeline, t1, t2, random_parameter='rnd'
)


def test_feature_union_weights():
# test feature union with transformer weights
Expand Down
0