Skip to content

Commit

Permalink
Merge 48d3c7e into cb01400
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjpfan committed Jul 12, 2018
2 parents cb01400 + 48d3c7e commit 94260c1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions sklearn/compose/tests/test_column_transformer.py
Expand Up @@ -777,3 +777,8 @@ def test_column_transformer_no_estimators():
assert len(ct.transformers_) == 1
assert ct.transformers_[-1][0] == 'remainder'
assert ct.transformers_[-1][2] == [0, 1, 2]


def test_column_transformer_no_estimators_set_params():
ct = ColumnTransformer([]).set_params(n_jobs=2)
assert ct.n_jobs == 2
5 changes: 4 additions & 1 deletion sklearn/utils/metaestimators.py
Expand Up @@ -41,7 +41,10 @@ def _set_params(self, attr, **params):
if attr in params:
setattr(self, attr, params.pop(attr))
# 2. Step replacement
names, _ = zip(*getattr(self, attr))
items = getattr(self, attr)
names = []
if items:
names, _ = zip(*items)
for name in list(six.iterkeys(params)):
if '__' not in name and name in names:
self._replace_estimator(attr, name, params.pop(name))
Expand Down

0 comments on commit 94260c1

Please sign in to comment.