Implementing k-fold cross validation involves the following steps:
Shuffle the dataset randomly. Split the dataset into k groups. For each unique group:
Take the group as a hold-out or test data set. Take the remaining groups as a training data set. Fit a model on the training set and evaluate it on the test set. Retain the evaluation score and discard the model.
Summarize the skill of the model using the sample of model evaluation scores.