ML1: Thinking in machine learning

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

The workflow: train, validate, test, and keep records

🎯You'll be able to

Describe the steps of an ML project, explain why data is split three ways, and keep a record that lets someone else repeat your result.

🏠The everyday picture

Students practise with past papers (training), take a mock exam to see where they stand and adjust (validation), and then sit the real exam once (test). If they saw the real exam paper while practising, their result would say nothing about what they know.

📘What it really is

📝A worked example

Input: in the kit, run:

python -m dakdost.train

Expected output (reference solution, measured on 2 November 2026): test PR-AUC 0.6235 (baseline 0.0968), recall 0.5349, precision 0.6647, threshold 0.3. Open models/metrics.json: it records the date ranges of the three sets, the validation scores used to choose the model (gradient boosting 0.5617 against logistic regression 0.5513), the threshold rule and the June figures. Run it again: the figures are identical, because the seed is fixed. In the starter, the figures change on every run and look far better, for reasons the projects uncover.

🌍Where it's used

📝Case scenario

A team tried 40 settings and reported the best test score in a presentation. When the model went live, it did noticeably worse. They had used the test set as a validation set 40 times, so the best result was partly luck. The next version kept a test month aside and touched it once.

🖱️Try it

Open models/metrics.json from the reference run figures above (or your own run once Project 1 works) and write three sentences: what each set covers, what the validation set was used for, and the one June figure you would quote. Success: you quote a June figure, not a May one, and you name the threshold rule.

⚠️Common mistakes

🛠️For your project

Project 1's tests check the split dates, the threshold chosen on May, figures that match a recomputation, and reproducible training.

✅Quick check

What is the validation set for?

Show the answer

Comparing models and settings, and choosing a threshold, without touching the test set.

Why use the test set only once?

Show the answer

Each use fits your choices a little to it, so its result stops being an honest estimate.

← PreviousBaselines first
ProLearners Assist