make_pipeline#

make_pipeline(*steps)[源代码][源代码]#

从任何类型的估计器创建一个管道。

参数:
步骤sktime 估计器的元组

按照用于管道构建的相同顺序

返回:
管道包含步骤的 sktime 管道,按顺序排列

始终是 BaseObject 的子类,具体对象由 scitype 决定,相当于 step[0] * step[1] * … * step[-1] 的结果

示例

示例 1: 预测器管道

>>> from sktime.pipeline import make_pipeline
>>> from sktime.transformations.series.exponent import ExponentTransformer
>>> from sktime.forecasting.trend import PolynomialTrendForecaster
>>> pipe = make_pipeline(ExponentTransformer(), PolynomialTrendForecaster())
>>> type(pipe).__name__
'TransformedTargetForecaster'

示例 2:分类器管道

>>> from sktime.pipeline import make_pipeline
>>> from sktime.transformations.series.exponent import ExponentTransformer
>>> from sktime.classification.distance_based import KNeighborsTimeSeriesClassifier
>>> pipe = make_pipeline(ExponentTransformer(), KNeighborsTimeSeriesClassifier())
>>> type(pipe).__name__
'ClassifierPipeline'

示例 3:转换器管道

>>> from sktime.pipeline import make_pipeline
>>> from sktime.transformations.series.exponent import ExponentTransformer
>>> pipe = make_pipeline(ExponentTransformer(), ExponentTransformer())
>>> type(pipe).__name__
'TransformerPipeline'