ML9: MLOps: tracking, monitoring and retraining

Lesson 1 of 5 · reading 15–25 minutes; practice and project time is on the module page

Experiment tracking and reproducibility

🎯You'll be able to

Record each training run's code, data, settings, seed and results, so that any result can be found and repeated.

🏠The everyday picture

A good cook trying new recipes writes down each attempt: the amounts, the oven temperature, the time and how it tasted. Without notes, the best version is lost the moment they try another.

📘What it really is

📝A worked example

Input: the reference solution, run twice.

python -m dakdost.train
md5sum raw/shipments.csv

Expected output (2 November 2026): both runs print test PR-AUC 0.6235 (baseline 0.0968), recall 0.5349, precision 0.6647, threshold 0.3, and the data's MD5 hash starts 422fcfa7ef9f. metrics.json records the model version (2026.07.1), the features, the split dates, the validation scores used to choose (0.5617 against 0.5513), the threshold rule and all June figures. Adding the git commit and the hash to metrics.json would complete the record.

🌍Where it's used

📝Case scenario

A team's best fraud model came from "the run on Thursday". Nobody could repeat it: the notebook had been edited, the data file overwritten and the seed not set. They retrained, got a worse result, and spent two weeks trying to recover the old one. From then on, every run wrote its commit, data hash, settings and results to a tracking table.

🖱️Try it

Add two fields to metrics.json in your Project 1 solution: data_md5 (the hash of raw/shipments.csv) and git_commit (from git rev-parse HEAD, or "not in git"). Success: two runs give identical files apart from any timestamp.

⚠️Common mistakes

🛠️For your project

Project 1's test 9 checks that training twice gives the same PR-AUC.

✅Quick check

What must be recorded to repeat a training run?

Show the answer

The code version, data version, settings, seed, library versions and results.

Why move final training out of a notebook?

Show the answer

Notebook cells can be run out of order, so the result may not be repeatable.

← BackML9
ProLearners Assist