Well, we are not restricting it to two, but 2 is the minimum number of splits we need to choose. If we e.g. choose 1 the training data splitter and the evaluation algorithm would complain as there would be no test set. That is why the minimum of parts we split the data into is two.

@tmbo, I figured out the reason for getting num_of_splits 2. Most of the times in my text classification training samples, my np.bincount(y) array has a minimum value <=10, so np. min return this and divides by 5 results the overall splits for this training data to 2.