Skip to content
BIASED

Testing ML systems

Block 1 of 6~3 min

Define a testable contract

Renaming an uploaded card must not change whether its preview needs repair. A classifier can pass an accuracy check while violating that requirement, especially if the evaluation data repeats the same accidental relationship between filenames and labels. A test must state the relationship directly.

An aggregate score leaves behaviour unspecified

A held-out score estimates performance on the sampled population. It does not specify correct handling of malformed inputs, serialization, duplicate requests or future populations. Keep the evaluation set, but give each additional requirement its own observation and acceptance rule.

Our original fixture uses a deliberately simple score for a preview. Let b∈[0,1]b\in[0,1] be a blur indicator and m∈{0,1}m\in\{0,1\} indicate missing metadata. Define

s(b,m)=min⁡(1,0.1+0.8b+0.1m).s(b,m)=\min(1,0.1+0.8b+0.1m).

A score of at least 0.6 requests review. This is a hand-specified test double, not a trained predictor or a calibrated probability. Its simplicity lets us determine expected behaviour exactly before testing a learned replacement.

Test both definite rules and uncertain quality

A schema violation is a definite failure. An estimated accuracy difference is uncertain because a finite sample could have been different. Mixing those cases into one numerical threshold makes failures hard to interpret. Report invalid input, broken invariants and statistical evidence separately.

Some requirements can be checked without labels. If document identity is metadata only, changing it should preserve the score. If the declared score is monotone in blur, increasing blur should not reduce the score. These relations must come from the product or mathematical specification; they are not automatically true for every ML task.

A rubric is a prompt to examine missing evidence

Breck and coauthors' ML Test Score proposes 28 checks covering data, models, infrastructure and monitoring (2017). It is a production-readiness rubric, not a proof of generalization or a replacement for application requirements. Our checks below are derived from the preview contract; the paper's tables and examples are not reproduced.

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.

  • Find a forbidden identifier dependencyoptional

    The score is a hand-specified test double, not a learned probability. Numeric blur is finite in [0,1], missing is 0/1, IDs are strings; this is not a general raw-record schema validator. The optional bug adds a filename-dependent term. The gradient and serialization checks establish arithmetic, not model quality.

    ~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.