liveBook · Manning

Cross-validation

As explained in Delivering Machine Learning Projects: From design to deployment

Cross-validation is a resampling technique that repeatedly trains and evaluates a model on different partitions of available data.

Cross-validation estimates model performance by repeatedly training on most data partitions and testing on the remaining partition. Aggregating the results produces a cross-validated score while keeping each test partition outside that training run, reducing information leakage and unconscious optimization. section 8.2.1

Use a cross-validation ticket or evaluation checklist to:

  • Divide the dataset into disjoint partitions, such as ten folds. section 8.2.1
  • Train a separate model for each fold, holding that fold out for testing and using the others for training. section 8.2.1
  • Aggregate the fold-level results and compare relevant measures rather than relying on accuracy alone. section 8.2.1 section 8.6
  • Record the computational trade-off: cross-validation suits simple models and small or sparse datasets but becomes expensive for complex models and large datasets. section 8.2.1
Table 8.1 Generating a cross-validation set (view table figure)

P1

P2

P3

P4

P5

P6

P7

P8

Set 1

Test

Train

Train

Train

Train

Train

Train

Train

Set 2

Train

Test

Train

Train

Train

Train

Train

Train

Set 3

Train

Train

Test

Train

Train

Train

Train

Train

Set 4

Train

Train

Train

Test

Train

Train

Train

Train

Set 5

Train

Train

Train

Train

Test

Train

Train

Train

Set 6

Train

Train

Train

Train

Train

Test

Train

Train

Set 7

Train

Train

Train

Train

Train

Train

Test

Train

Set 8

Train

Train

Train

Train

Train

Train

Train

Test

Use the fold matrix to verify that each partition serves as the test set once while the remaining partitions serve as training data. section 8.2.1

How Delivering Machine Learning Projects: From design to deployment covers it

How deep it goes
Defines rotating train/test partitions, score aggregation, leave-one-out evaluation, and computational limits without developing algorithmic internals.
Examples
Uses ten-fold evaluation, an eight-partition P1–P8 matrix, and leave-one-out evaluation across 1,000 examples.
What it assumes
Assumes a model-training pipeline and basic train/test evaluation; teaches repeated partitioning and held-out scoring.
What you can do after
Evaluate model performance by rotating held-out partitions, aggregating scores, and documenting measurement trade-offs for selection.
How it connects
Connects train/test splits, model selection, precision, recall, F1 score, A/B testing, and multi-armed bandits.

Also explained in

Compare how 12 books explain cross-validation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Delivering Machine Learning Projects: From design to deployment. The section links point to the parts of the book it draws on.