Though the cross_val_score function from the model_selection module acts as a complete helper function for most of the cross-validation purposes, you may have the need to build up your own cross-validation process. In this case, the same model_selection module guarantees a formidable selection of iterators.
Before examining the most useful ones, let's provide a clear overview of how they function by studying how one of the iterators, model_selection.KFold, works.
KFold is quite simple in its functionality. If n-number of folds is given, it returns n iterations to the indexes of the training and validation sets for the testing of each fold.
Let's say that we have a training set made up of 100 examples and we ...