compileml.monitor

baseline_staleness

def baseline_staleness(artifact, X_reference, X_current) -> dict

from compileml.monitor import baseline_staleness

How far the frozen baseline has moved in population rank, per feature.

The baseline is both the imputation value and the attribution reference point, so it matters when it stops describing the population. Raw deltas are not comparable across features, so this measures rank: the baseline's percentile among non-missing values in each population, with ties counted half, and the shift between them. Missing rates are reported alongside, because a missing value is imputed at the baseline.

Features are ranked by absolute percentile shift. No pass/fail threshold is applied.

Parameters#

NameTypeDefaultKind
artifact—requiredpositional
X_reference—requiredpositional
X_current—requiredpositional

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.

Worked example: baseline_staleness →