I guess I understand the basic idea of cross-validated, partitioning a training set into k folds, fitting a model and computing the score k consecutive times.
I am trying to figure out the details. Take iris dataset as our example
- partition 150 instances into training set of 90 and test set of 60.
- partition 90 instances into 5 folds,
What is the detailed procedure of the following code?
>>> scores = cross_val_score(clf, X, y, cv=5)
>>> scores
array([0.96..., 1. ..., 0.96..., 0.96..., 1. ])
Does the detailed procedure run this way?
split 1: perform training on fold2 to fold5, perform validating on the remaining part, fold1 in this case.
split 2: perform training on fold1, fold3 to fold5, perform validating on the remaining part, fold2 in this case.
Are the fold1s in split 1 and split 2 the same fold? In other words, is it necessary to randomize the training set before split 2?