builder.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:Optimus 作者: Yatoom 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号