Cross-Validation

Also known as · K-Fold Cross-Validation

K-fold evaluation: split the data into KK folds, hold one out as the test set in each round, train on the rest, and average the KK scores. It gives a more robust score than a single split, which can be lucky or unlucky.

When to use

Use it to compare models or choose a regularisation strength such as alpha. Put scaling inside a Scikit-Learn Pipeline so it is refitted for each fold, otherwise test information leaks into training. The lecture calls K=10K = 10 the standard default.

See DS Lec 4.

Appears in