def make_union(*transformers, **kwargs):
"""Construct a FeatureUnion with alternative estimators to search over
Parameters
----------
steps
Each step is specified as one of:
* an estimator instance
* None (meaning no features)
* a list of the above, indicating that a grid search should alternate
over the estimators (or None) in the list
kwargs
Keyword arguments to the constructor of
:class:`sklearn.pipeline.FeatureUnion`.
Notes
-----
Each step is named according to the set of estimator types in its list:
* if a step has only one type of estimator (disregarding None), it takes
that estimator's class name (lowercased)
* if a step has estimators of mixed type, the step is named 'alt'
* if there are multiple steps of the same name using the above rules,
a suffix '-1', '-2', etc. is added.
"""
steps, grid = _name_steps(transformers)
return set_grid(_FeatureUnion(steps, **kwargs), **grid)
评论列表
文章目录