clustering.py 文件源码

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

项目:ramp-workflow 作者: paris-saclay-cds 项目源码 文件源码
def get_cv(self, X, y):
        unique_event_ids = np.unique(y[:, 0])
        event_cv = ShuffleSplit(
            n_splits=self.n_cv, test_size=self.cv_test_size,
            random_state=self.random_state)
        for train_event_is, test_event_is in event_cv.split(unique_event_ids):
            train_is = np.where(
                np.in1d(y[:, 0], unique_event_ids[train_event_is]))[0]
            test_is = np.where(
                np.in1d(y[:, 0], unique_event_ids[test_event_is]))[0]
            yield train_is, test_is
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号