K-fold cross-validation (source code)

= K-fold cross-validation
{c}
{wiki}

K-fold cross-validation partitions observations into $K$ folds, trains $K$ times while holding out one fold at a time, and combines the held-out losses.