## Beyond Train/Test Split
Cross-validation improves on a single train/test split by using the data more efficiently — training and testing on multiple splits and averaging the results.
## K-Fold Cross-Validation
Standard k-fold:
1. Split data into k equal folds (e.g. k=5)
2. For each fold: train on the other k−1 folds, test on this fold
3. Average test performance across all k folds
**Problem for time-series data:** Standard k-fold randomly assigns matches to folds, which allows future data to inform predictions of past matches — a form of lookahead bias.
## Time-Series Cross-Validation
For sports data, use time-blocked cross-validation:
- Block 1: Train on season 1, test on first half of season 2
- Block 2: Train on seasons 1–2, test on second half of season 2
- Block 3: Train on seasons 1–2, test on season 3
- Continue...
This preserves the temporal ordering and simulates real deployment conditions.
## The Leave-One-Match-Out Test
Extreme version: for each match, train on all other matches and predict this one. Most computationally expensive but most rigorous.
For computational efficiency: leave-one-season-out is more practical and nearly as informative.
## Nested Cross-Validation for Hyperparameter Tuning
When you are also selecting model hyperparameters (e.g. decay rate, regularisation strength): use nested cross-validation.
- Outer loop: splits for model evaluation
- Inner loop: splits for hyperparameter selection within the training set
This prevents "double-dipping" on the test set for both hyperparameter selection and evaluation.
Create a free account to track your progress and save bookmarks.