Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3938adc

Browse files
committed
Extend FeatureUnion to support the verbose kwarg as well
1 parent 1b7245e commit 3938adc

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

doc/whats_new.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ Miscellaneous
5454
:class:`pipeline.FeatureUnion` for showing progress and timing of each
5555
step. :issue:`8568` by :user:`Karan Desai <karandesai-96>`.
5656

57+
- Added optional parameter ``verbose`` in functions `pipeline.make_pipeline`
58+
and `pipeline.make_union` to extend the same functionality as the
59+
corresponding classes. :issue:`9668` by
60+
:user:`Baze Petrushev <petrushev>`.
61+
5762

5863
Bug fixes
5964
.........

sklearn/pipeline.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,9 @@ def make_pipeline(*steps, **kwargs):
601601
inspect estimators within the pipeline. Caching the
602602
transformers is advantageous when fitting is time consuming.
603603
604+
verbose : boolean, optional
605+
Verbosity mode.
606+
604607
Examples
605608
--------
606609
>>> from sklearn.naive_bayes import GaussianNB
@@ -896,6 +899,9 @@ def make_union(*transformers, **kwargs):
896899
n_jobs : int, optional
897900
Number of jobs to run in parallel (default 1).
898901
902+
verbose : boolean, optional
903+
Verbosity mode.
904+
899905
Returns
900906
-------
901907
f : FeatureUnion
@@ -917,9 +923,11 @@ def make_union(*transformers, **kwargs):
917923
transformer_weights=None, verbose=False)
918924
"""
919925
n_jobs = kwargs.pop('n_jobs', 1)
926+
verbose = kwargs.pop('verbose', False)
920927
if kwargs:
921928
# We do not currently support `transformer_weights` as we may want to
922929
# change its type spec in make_union
923930
raise TypeError('Unknown keyword arguments: "{}"'
924931
.format(list(kwargs.keys())[0]))
925-
return FeatureUnion(_name_estimators(transformers), n_jobs=n_jobs)
932+
return FeatureUnion(_name_estimators(transformers), n_jobs=n_jobs,
933+
verbose=verbose)

0 commit comments

Comments
 (0)