1
$\begingroup$

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?

$\endgroup$
2
$\begingroup$

It determines the splitting strategy used by sklearn.

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

enter image description here

Doc

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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