drift_decomposition
from compileml.monitor import drift_decomposition
Decompose the change in mean raw score, current minus reference, by feature.
Both lists come from decide(artifact, row, include_contributions=True)
under one artifact. The quantity decomposed is mean raw score movement,
2 * (raw_micro - baseline_micro) in half-micro units; both populations
share the baseline, so it is exactly the change in mean raw score. The
per-feature shifts sum to it with == — the same arithmetic as fairness
§6, and the same report shape.
latent_int is not decomposed, because the runtime clamps it to the
unit interval; each side's mean is reported under latent_context for
reading alongside.
After recalibrate_artifact the artifact hash changes but the model and
baseline do not. Re-run decide() on the reference rows under the new
artifact; their contributions come out identical.
Raises: ValueError: if either list is empty, lacks contributions, carries a nonzero attribution residual, or the decisions come from more than one artifact.
Parameters#
| Name | Type | Default | Kind |
|---|---|---|---|
| reference_decisions | — | required | positional |
| current_decisions | — | required | positional |
Returns#
dict
Raises#
- ValueError
Read from the function body and the private helpers it calls, not inferred. A function that raises nothing has no section here.