split.py 文件源码

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

项目:skutil 作者: tgsmith61591 项目源码 文件源码
def __init__(self, n_folds, shuffle, random_state):
        if not isinstance(n_folds, numbers.Integral):
            raise ValueError('n_folds must be of Integral type. '
                             '%s of type %s was passed' % (n_folds, type(n_folds)))

        n_folds = int(n_folds)
        if n_folds <= 1:
            raise ValueError('k-fold cross-validation requires at least one '
                             'train/test split by setting n_folds=2 or more')

        if shuffle not in [True, False]:
            raise TypeError('shuffle must be True or False. Got %s (type=%s)'
                            % (str(shuffle), type(shuffle)))

        self.n_folds = n_folds
        self.shuffle = shuffle
        self.random_state = random_state
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号