I'm trying to understand how to use the cross-validation function sklearn.model_selection.KFold
. If I define (like in this tutorial)
from sklearn.model_selection import KFold
kf = KFold(n_splits=5, shuffle=False, random_state=100)
I get
ValueError: Setting a random_state has no effect since shuffle is False.
You should leave random_state to its default (None), or set shuffle=True.
What does this error mean and why is it necessary to set random_state=None
or shuffle=True
?