This documentation is for scikit-learn version 0.11-gitOther versions

Citing

If you use the software, please consider citing scikit-learn.

This page

8.3.12. sklearn.cross_validation.check_cv

sklearn.cross_validation.check_cv(cv, X=None, y=None, classifier=False)

Input checker utility for building a CV in a user friendly way.

Parameters :

cv: an integer, a cv generator instance, or None :

The input specifying which cv generator to use. It can be an integer, in which case it is the number of folds in a KFold, None, in which case 3 fold is used, or another object, that will then be used as a cv generator.

X: 2D ndarray :

the data the cross-val object will be applied on

y: 1D ndarray :

the target variable for a supervised learning problem

classifier: boolean optional :

whether the task is a classification task, in which case stratified KFold will be used.