In sklearn, there is a method for cross validation called cross_val_score. One of the parameters of this method is 'cv'.

I understand in cross validation, there is no splitting the data into training and validation (70-30 split). Instead, you split the data into 'k' subsamples, then train it on the K-1 subsamples and validate using the kth sample. And repeat it for each of the 'k' subsamples.

So is this cv = k, i.e the number of subsamples in which you split the training data?


1 Answer 1


It determines the splitting strategy used by sklearn.

The default (“none”) is 3-fold CV.

enter image description here


  • $\begingroup$ So cv=k, the number of subsamples or folds,correct,? $\endgroup$
    – Victor
    Commented Jan 15, 2018 at 22:13
  • $\begingroup$ Correct, the number of folds used in the stratified sampling. $\endgroup$
    – Cybernetic
    Commented Jan 15, 2018 at 23:17
  • $\begingroup$ @Victor, please consider accepting / upvoting an answer if you think it has answered your question $\endgroup$ Commented Jan 16, 2018 at 22:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.