Utilities.py 文件源码

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

项目:a-cadmci 作者: florez87 项目源码 文件源码
def getFolds(labels, number_folds):
        """
        Provides train/test indices to split data in train test sets.

        Parameters
        ----------
        labels: array-like of shape = [number_samples]
            The target values (class labels in classification).

        number_folds: int
            The amount of folds for the k-fold cross-validation.

        Return
        ----------
        folds: StratifiedKFold
            the train/test indices of the splitted data. 
        """
        return StratifiedKFold(y=labels, n_folds=number_folds, shuffle=True)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号