It splits training data into k folds, trains on k-1 folds, validates on the remaining one, and averages the k scores.
It gives a more reliable estimate of generalization than a single split and makes better use of limited data; it is also used for hyperparameter tuning.
Use stratified k-fold for classification with imbalanced classes.
For time series use forward-chaining splits (for example scikit-learn's TimeSeriesSplit); random shuffling would leak future information.
Loading…