Concept

K-Fold Cross-Validation

To perform KK-fold cross-validation on a dataset with nn observations, the training set is separated into KK sets by randomly sampling n/Kn/K observations from the dataset into each fold. The model of interest is then trained on K1K-1 folds and validated on the left-out fold; that is, once the model is trained, we use it to make predictions on the group that was left out of training. This process repeats KK times. To evaluate the model's overall performance, we calculate the average validation error across all KK tests. KK-fold cross-validation provides a robust estimate of the empirical testing error of a model and is particularly useful for selecting model designs and adjusting hyperparameters.

Image 0

0

7

Updated 2026-05-07

Tags

Data Science

D2L

Dive into Deep Learning @ D2L