-
-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
[MRG+1] Add verbose option to Pipeline, FeatureUnion, and ColumnTransformer #11364
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some first comments
Additionally, make_column_transformer
is missing support for verbose
attribute
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])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hasn't been addressed
[est for _, est in self.steps[:step_idx + 1] if est is not None]) | ||
return '(step %d of %d) Fitting %s' % (step_num, n_steps, | ||
self.steps[step_idx][0]) | ||
|
||
# Estimator interface | ||
|
||
def _fit(self, X, y=None, **fit_params): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_fit_transform_without_final
sounds great to me
This PR has been updated to use the phrase "Processing _____" when returning the verbose output. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicks but LGTM
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
be multipled by ``weight``. | |
be multiplied by ``weight``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicks but LGTM
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.py
to work withColumnTransformer
.