Machine learning with football · Chapter 11 · Production ML systems

Deployment testing

Tests for data, features, the model and the pipeline, run on this season's real data.

Estimated time: 10 minutes · page 5 of 8

Test before it goes live

A full machine learning system needs tests for the input data, the feature engineering, the quality of each new model, the serving infrastructure, and how the pieces fit together. The board runs a small suite in your browser on this season's real data.

  • Data: the raw rows follow the rules, such as whole-number scores, known clubs and no duplicates.
  • Features: engineered values look right, such as a one-hot vector with exactly one 1.
  • Reproducibility: the same seed gives the same starting network, so a result can be repeated.
  • Training runs: one step of gradient descent on sample data lowers the loss. That cheap test catches broken code without a full training run.
  • Quality: a new model must clear a fixed bar on matches it hasn't seen. Comparing only with the last version catches sudden drops. A fixed bar also catches slow decline across many versions.
  • Pipeline: the data feeding the model is fresh.

You can't write the quality test first, as test-driven development would like, because nobody knows the achievable loss before training. Find it during development, then hold every later version to it. Integration tests that run the whole pipeline are slow, so they often train on a subset or a simpler model.

Check yourself

Why can you not write the loss test before training, as test-driven development would want?
How do you catch a model that gets a little worse with every version, too little to notice each time?

Leagues