learner.py 文件源码

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

项目:mlens 作者: flennerhag 项目源码 文件源码
def _predict(self, transformers, score_preds):
        """Sub-routine to with sublearner"""
        n = self.in_array.shape[0]
        # For training, use ytemp to score predictions
        # During test time, ytemp is None
        xtemp, ytemp = slice_array(self.in_array, self.targets, self.out_index)
        t0 = time()

        if transformers:
            xtemp, ytemp = transformers.transform(xtemp, ytemp)
        predictions = getattr(self.estimator, self.attr)(xtemp)

        self.pred_time_ = time() - t0

        # Assign predictions to matrix
        assign_predictions(self.out_array, predictions,
                           self.out_index, self.output_columns, n)

        # Score predictions if applicable
        if score_preds:
            self.score_ = score_predictions(
                ytemp, predictions, self.scorer, self.name_index, self.name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号