def build_pipeline(base_estimator, parameters):
"""
Builds a pipeline where the base estimator is initialized with given parameters. The `@preprocessor` parameter
is a special parameter that will determine which pre-processing steps to use.
:param base_estimator: The base estimator of the pipeline
:param parameters: The parameters for the base estimator, includes special parameters for the pipeline itself
:return: The (pipeline with the) base estimator, initialized with given parameters
"""
params = copy(parameters)
preprocessors = Builder.extract_preprocessors(params)
estimator = Builder.setup_estimator(base_estimator, params)
if preprocessors is None:
return estimator
return make_pipeline(*preprocessors, estimator)
评论列表
文章目录