HomeRoadmapsAI Governance Day 6
AI Governance, Fairness & Regulated Assurance Β· Day 6 Β· 20 min

Model Risk, Lineage & PSI Drift
AI Governance, Fairness & Regulated Assurance β€” Day 6

Bind model, prompt, and dataset versions into an immutable lineage manifest, measure Population Stability Index (PSI) and accuracy drift, and trigger automated MRM revalidation.

⚑ Runtime: Python 3.10+ Β· Zero External Dependencies (unittest)πŸ›‘οΈ AI Governance & Regulated Assurance QE Lead
Model RiskLineage ManifestPSI DriftRevalidationMRM
About this lab

A model validated at release time can silently degrade as macroeconomic conditions or customer behavior shift. Today you will enforce immutable version lineage (rejecting mutable tags like latest), compute Population Stability Index (PSI), and trigger automated revalidation when drift exceeds thresholds.

πŸ“¦Sample Codebase & Working Solution (Day 6)Available Now
View on GitHub

The official reference codebase for Day 6 is hosted in the repository. Clone the repository and navigate to day-6-model-risk-drift/test_day6.py to run the working solution.

Git Clone β€” Working Solution
git clone https://github.com/777abhi/ai-governance-qe-roadmap.git
cd ai-governance-qe-roadmap/day-6-model-risk-drift/test_day6.py
🏭Production Context & Regulated Implementation
πŸ’‘ Why We Are Doing This: Model Risk Management frameworks require exact reproducibility of which model, prompt, and dataset produced a historical decision, plus continuous drift surveillance.
🏒 Real-World Production Usecase: Failing CI builds that reference mutable model tags, and firing automated MRM revalidation tickets whenever PSI >= 0.25 or accuracy drops by more than 5%.
βš™οΈ How Implemented in Production: LineageManifest with SHA-256 digest, population_stability_index, and evaluate_drift_and_revalidation in govlab/model_risk.py.
Phase 1

Run & Inspect Lineage & PSI Drift Tests

Run the Day 6 suite to verify lineage immutability and PSI drift triggers.

Step 1.1: Run Day 6 Model Risk & Drift Tests
Terminal β€” Day 6 Lab
npm run test:day6
Step 1.2: Population Stability Index (PSI) Calculation
govlab/model_risk.py
def population_stability_index(expected_buckets, actual_buckets, epsilon: float = 1e-6):
    sum_exp, sum_act = sum(expected_buckets), sum(actual_buckets)
    psi = 0.0
    for e_raw, a_raw in zip(expected_buckets, actual_buckets):
        e = max(e_raw / sum_exp, epsilon)
        a = max(a_raw / sum_act, epsilon)
        psi += (a - e) * math.log(a / e)
    return round(psi, 6)
Day 6 Key Learnings
  • Validated immutable model, prompt, and dataset version lineage with deterministic SHA-256 digests.
  • Calculated Population Stability Index (PSI) to classify stable (<0.10), moderate (0.10–0.25), and critical (>=0.25) shifts.
  • Built an automated MRM revalidation trigger engine combining PSI and accuracy-drop ceilings.

🧠 Knowledge Check

In standard Model Risk Management (MRM), what does a Population Stability Index (PSI) of 0.25 or higher signify?