make_union#
- sklearn.pipeline.make_union(*transformers, n_jobs=None, verbose=False)[源代码]#
构建
FeatureUnion
来自给定的变压器。This is a shorthand for the
FeatureUnion
constructor; it does not require, and does not permit, naming the transformers. Instead, they will be given names automatically based on their types. It also does not allow weighting.- 参数:
- *transformers估计者列表
一个或多个估计器。
- n_jobsint,默认=无
要并行运行的作业数。
None
意思是1,除非在a中joblib.parallel_backend
上下文-1
意味着使用所有处理器。看到 Glossary 了解更多详细信息。在 v0.20 版本发生变更:
n_jobs
默认值从1更改为无。- verbose布尔,默认=假
如果为True,则安装每个Transformer时所花费的时间将在安装完毕时打印出来。
- 返回:
- fFeatureUnion
A
FeatureUnion
对象,用于连接多个Transformer对象的结果。
参见
FeatureUnion
类,用于连接多个Transformer对象的结果。
示例
>>> from sklearn.decomposition import PCA, TruncatedSVD >>> from sklearn.pipeline import make_union >>> make_union(PCA(), TruncatedSVD()) FeatureUnion(transformer_list=[('pca', PCA()), ('truncatedsvd', TruncatedSVD())])