ML10: Capstone: three AI projects for DakDost

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

Project 2: a model people can call

🎯You'll be able to

Serve Project 1's model through an API that rejects bad input, matches the offline model, reports its health and watches for drift.

🏠The everyday picture

A pharmacy counter checks each prescription, gives the right medicine with clear instructions, keeps a record without gossiping about patients, and notices when an unusual number of the same prescription starts arriving.

📘What it really is

📝A worked example

Input: the reference API (2 November 2026).

Expected output:

🌍Where it's used

📝Case scenario

A learner's API passes everything except test 5, the comparison with the offline model. They spend an hour on the model before noticing that their API builds features with its own code. Switching to the shared build_frame fixes it in one line, and they add a sentence on training/serving skew to their case study.

🖱️Try it

Start your API with uvicorn dakdost.serve:app --port 8000 and try /docs in a browser: send one good request, one with a negative weight and one batch of 101. Success: you see a probability, a 422 with a reason and a 413.

⚠️Common mistakes

🛠️For your project

This lesson is Project 2. Its page has the marking guide and the evidence to submit.

✅Quick check

Why must the API use the same feature code as training?

Show the answer

Otherwise the model gets inputs prepared differently from the ones it learned from: training/serving skew.

What should August's drift report name?

Show the answer

address_quality and dest_zone.

← PreviousProject 1: a model with honest figures
ProLearners Assist