Documenting Inputs and Outputs of a Prediction

A model interface needs the feature fields, units, allowed missing values, and meanings of results or error states.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace a scoring call
  2. Keep decisions explicit
  3. Turn model inputs and outputs into a fixed fixture
  4. Test the exported artifact as a consumer will call it

Trace a scoring call

If distance was trained in kilometers, giving meters without conversion changes the predicted score. Include examples with exact expected preprocessing. See database and measurement units.

Keep decisions explicit

A result can expose a probability and a separate policy outcome. Verify their interpretation independently. Probability and action thresholds describe those responsibilities.[1]

Turn model inputs and outputs into a fixed fixture

A delay predictor can accept distance in metres and dispatch hour encoded under one time-zone rule, then return expected minutes. A schema should name feature units, order, missing policy and the meaning of the output. See preprocessing at serving time.

Input example: distance_m=8000, dispatch_hour=10
Feature pipeline produces model values in an agreed order
Output: expected delay 12 minutes under this interface

Test the exported artifact as a consumer will call it

A service sending kilometres into a metres field can get plausible but invalid results. Compare one known inference end to end, including missing inputs and model version.

References

  1. Gareth James et al., An Introduction to Statistical Learning ↩