k; margin: auto;" /&gt;

.col-left[.hi-slate[Validation set]]
.col-right[.hi-purple[Rest of training set]]

---
layout: true
# Cross-validation
## *k*-fold cross-validation

---
name: resampling-kcv

Even better is to use .hi[k-fold cross validation].

1. .b[Divide] the training data into `\(k\)` equally sized groups (folds).
2. .b[Iterate] over the `\(k\)` folds, treating each as a validation set once&lt;br&gt;(training the model on the other `\(k-1\)` folds).
3. .b[Average] the folds' MSEs to estimate tes