MPIGridSearchCV.py 文件源码

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

项目:palladio 作者: slipguru 项目源码 文件源码
def _create_batches(self):
        param_iter = ParameterGrid(self.param_grid)

        # divide work into batches equal to the communicator's size
        work_batches = [[] for _ in range(comm_size)]
        i = 0
        for fold_id, (train_index, test_index) in enumerate(self.cv_iter):
            for parameters in param_iter:
                work_batches[i % comm_size].append((fold_id + 1, train_index,
                                                    test_index, parameters))
                i += 1

        return work_batches
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号