Artificial intelligence · University
Cross-validation, grouped data and time-aware splits
A k-fold procedure rotates held-out folds to estimate performance for a specified training process. Splits and all fitted preprocessing must be controlled.
Prerequisites
Training/validation concepts and averages.
Study notes
Cross-validation
A k-fold procedure rotates held-out folds to estimate performance for a specified training process. Splits and all fitted preprocessing must be controlled.
Grouped records
When multiple records share a person, device or source, the split should match whether deployment encounters new or known groups.
Time series
Forecast evaluation must respect time order. Training on future information while predicting earlier records creates a misleading task.
Nested choices
Using the same folds for extensive tuning and final performance reporting can produce optimistic estimates. Separate outer evaluation or a final untouched test can help.
Worked examples
A 100-record dataset is divided equally into 5 folds. How many records are in one held-out fold?
100/5=20.
20
Three fold scores are 0.7,0.8,0.9. Find their arithmetic mean.
(0.7+0.8+0.9)/3=0.8.
0.8
Check your understanding
Which split is suitable when evaluating prediction on new devices?
- Keep records from each device within a single side of a split
- Randomly mix near-duplicate device records everywhere
- Always put labels into inputs
- Split only by filename length
For a genuine forecasting task, what should training data generally precede?
- No date restriction ever
- The alphabet's last letter
- The forecast evaluation time
- Only the output filename
Why must imputation or scaling be fitted inside each training fold?
What does nested cross-validation separate?
- Hyperparameter selection from outer evaluation
- Model names from file names
- All data from every label permanently
- Every numeric feature from computation
Answers and marking guidance
Answers and marking notes
- Keep records from each device within a single side of a split
Group-aware splits avoid sharing device-specific signals across sides.
- The forecast evaluation time
Use past information to predict later outcomes.
- Otherwise held-out data influence fitted preprocessing, producing leakage and an overly favourable assessment.
Credit preprocessing as part of the learned procedure.
- Hyperparameter selection from outer evaluation
Inner selection and outer evaluation serve different roles.
Further reading and review references
These are reference links, not copied exercises, institutional endorsement or proof of independent review.
AI-assisted preview; independent educational review required. Level labels describe prerequisites, not accreditation or official curriculum alignment.