Lessons › Chapter 14: ML in practice
Experiment tracking
experiment tracking records, for every run, the settings, the data version, the results and the saved model. Tools do this automatically with a couple of lines of code.
Watch it move. This lesson is interactive on Gradient Lab: every step is an animated scene you can replay.
Start the interactive lessonStep by step
Which run was it?
Nobody can remember which settings produced last month’s best fraud model.
Which run was the good one?
After a week of experiments you have dozens of models. Which settings gave 88%? Which data version? Without notes, nobody remembers, and the best model can’t be rebuilt.
Log every run
experiment tracking records, for every run, the settings, the data version, the results and the saved model. Tools do this automatically with a couple of lines of code.
Compare side by side
Now you can line runs up and see what changed. Run 4 wins at 88%, and the log says exactly why: lower learning rate, data version 12.
In real life: a lab notebook
Scientists write down every experiment so results can be checked and repeated. ML teams do the same with tracking tools, and in regulated areas like medicine or banking, being able to show how a model was built is often a requirement.
Quick check: What should you record for every training run?
- Settings, data version and results (correct)
- Only the final accuracy
- Nothing: just keep the best file
You need all three to compare runs fairly and to reproduce the winner.
Pseudocode
for each training run:
log settings: learning rate, layers, data version
log results: accuracy, loss curve, training time
save the model file with an ID
compare runs side by side → pick the best and know why
Key terms
- experiment tracking
- Recording the settings, data and results of every training run so you can compare and reproduce them.