Model Consistency
One of the main failure modes this repo is designed to prevent is inconsistency between:
- transform output
- model object used for predict
- model/decomp logic used for contribution outputs
Rule
For a given market/KPI build, transform, predict, and decomp must refer to the same intended model representation.
What This Means In Practice
If a model is rewritten for forecast/upload purposes, for example by replacing an inline combined term with an explicit single variable, then:
- transform must produce that rewritten variable
- the API model must be the updated model that expects it
- decomp must use that same updated model representation
Not Acceptable
Examples of inconsistency:
- transform produces updated variables but the API still uses the old stored model
- predict uses one model object while decomp closes over another
- decomp assumes a mapping or formula representation different from the build model
Why This Exists
This exact class of inconsistency was one of the initial problems surfaced by the China store visits investigation.