Skip to content
BIASED

Designing an ML system

Block 1 of 6~3 min

Connect the model to a decision

A preview service receives scanned study cards. Some previews are unreadable, and an editor can repair them before publication. Reviewing every upload is expensive; publishing a bad preview creates another support task. We need a decision about which cards to review, and a record of what happened after that decision.

The following counts and timing requirements define an original fictional service. They are assumptions for design arithmetic, not observations from an operating product.

Start with the decision

The service may place a card in the editor's queue or publish its preview. A score alone does neither. We must specify the threshold, the destination of a flagged item, the person who can release it, and what the user sees while waiting. Otherwise a classifier can improve while the product remains unchanged.

An editor's repair is also a future label. Store the prediction before the repair, with its document ID and release ID. Evaluating the repaired preview as though it were the original would answer a different question. This is a concrete reason to separate event time, prediction time and label time.

Does learning earn its complexity?

Start with a rule that flags a low contrast score. On a fictional labelled sample of 1,000 previews, 80 need repair. The table specifies two possible decision sets; it does not claim that a model was trained to produce them.

Decision set Bad previews flagged Good previews flagged Bad previews missed Editor queue
Contrast rule 48 92 32 140
Candidate classifier 68 52 12 120

For the candidate, recall is 68/80=0.8568/80=0.85: it finds 85% of bad previews. Precision is 68/120≈0.56768/120\approx0.567: only about 57% of its review queue needs repair. These answer different operational questions. Recall measures missed damage; precision determines how much review time is spent on good cards. The definitions are developed in Classification metrics.

Suppose a review costs two minutes and an undetected bad preview creates twelve minutes of later work. The total burden is

W=2(TP+FP)+12FN.W=2(TP+FP)+12FN.

Every flagged item consumes a review, including a false alarm. Only missed bad previews incur the second term. The rule costs 2⋅140+12⋅32=6642\cdot140+12\cdot32=664 minutes; the candidate costs 2⋅120+12⋅12=3842\cdot120+12\cdot12=384. Reviewing everything costs 2,000 minutes. The candidate is worth investigating under these assumptions. If later support work costs much less, the conclusion can change without any change in accuracy.

Answers are saved on the server and tied to this browser until you sign in.

Go deeper — optional

Code and labs do not count toward the main percentage or the certificate.

  • Review workload before deploymentoptional

    All confusion counts, costs and bounds are stipulated. The 130/day capacity comparison assumes daily arrivals reproduce this 1,000-item mix. Sequential per-request bounds can add; separate p95s cannot generally add.

    ~20 min · easier on a computer · The corresponding lesson and basic Python functions.

    Self-check in the notebook — not part of mastery or the certificate.