[MRG+1] Add verbose option to Pipeline, FeatureUnion, and ColumnTransformer#11364
[MRG+1] Add verbose option to Pipeline, FeatureUnion, and ColumnTransformer#11364jnothman merged 80 commits intoscikit-learn:masterfrom
Conversation
- Each line printed by Pipeline and FeatureUnion, when their verbosity mode is on, will be 70 characters long.
Fix error message bug
# Conflicts: # sklearn/pipeline.py # sklearn/utils/__init__.py # sklearn/utils/tests/test_utils.py
|
Thanks for fixing that up. This is nice. |
|
I updated this PR with verbose support in |
|
Merge conflicts fixed... for now. |
|
I'll review today |
sklearn/pipeline.py
Outdated
| .format(list(kwargs.keys())[0])) | ||
| return FeatureUnion(_name_estimators(transformers), n_jobs=n_jobs) | ||
| raise TypeError('Unknown keyword arguments: "{}"'.format( | ||
| list(kwargs.keys())[0])) |
|
|
||
| # Estimator interface | ||
|
|
||
| def _fit(self, X, y=None, **fit_params): |
There was a problem hiding this comment.
Not strictly related to this PR, but I find it confusing that this is called _fit while it actually does some transforming jobs as well.
There was a problem hiding this comment.
Mind as well call it _fit_transform or if we want to be more specific: _fit_transform_without_final :)
There was a problem hiding this comment.
_fit_transform_without_final sounds great to me
|
This PR has been updated to use the phrase "Processing _____" when returning the verbose output. |
sklearn/pipeline.py
Outdated
| Xt = last_step.fit_transform(Xt, y, **fit_params) | ||
| else: | ||
| Xt = last_step.fit(Xt, y, **fit_params).transform(Xt) | ||
| return Xt |
There was a problem hiding this comment.
Maybe we should use
if... :
return Xt
elif...:
return ...
else:
return ...
sklearn/pipeline.py
Outdated
| """ | ||
| Fits ``transformer`` to ``X`` and ``y``. The transformed result is returned | ||
| with the fitted transformer. If ``weight`` is not ``None``, the result will | ||
| be multipled by ``weight``. |
There was a problem hiding this comment.
| be multipled by ``weight``. | |
| be multiplied by ``weight``. |
|
Let's ship it! Thanks for wrapping it up, @thomasjpfan |
…ransformer (scikit-learn#11364)" This reverts commit bed12f6.
…ransformer (scikit-learn#11364)" This reverts commit bed12f6.
Reference Issues/PRs
Continues work on PR #10435.
Fixes #9668. Fixes #8568. Fixes #5298. Fixes #5321.
What does this implement/fix? Explain your changes.
Adapts the new functions in
pipeline.pyto work withColumnTransformer.