EX-30: Population Stability Index (PSI): Detect Feature Drift & Trigger Retraining
Track: AI Readiness & EU AI Act • Difficulty: Advanced • Mastery Points: 200 PTS
Business Problem Scenario
Under regulatory model risk management standards and EU AI Act Article 10 guidelines, machine learning feature distributions must be continuously monitored against production drift. Population Stability Index (PSI) is the industry standard statistical metric used by Global DynaDatum Bank. In accordance with Global DynaDatum Bank's internal governance policy, when PSI on credit utilization (utilisation_6m) reaches or exceeds 0.25 (indicating significant population drift), an automated circuit breaker must trip to halt automated credit approvals and schedule model retraining.
Engineering Objective
Write a statistical PSI monitoring query against silver.feature_drift_stats. • Expected Columns: feature_name, round(sum((actual_pct - expected_pct) * ln(actual_pct / expected_pct)), 4) AS psi_value, CASE WHEN sum((actual_pct - expected_pct) * ln(actual_pct / expected_pct)) >= 0.25 THEN 'SCHEDULE_MODEL_RETRAINING' ELSE 'STABLE' END AS drift_action • Acceptance Criteria: - Group by feature_name. - Filter for feature_name = 'utilisation_6m'. - Mathematical Note: PSI formula: sum((actual_pct - expected_pct) * ln(actual_pct / expected_pct)). In production, percentages are represented as fractions (0.0 to 1.0) and zero buckets are smoothed with small epsilon values. Key Concepts: - Population Stability Index (PSI): Statistical metric quantifying shift between baseline and production feature distributions (Global DynaDatum Bank policy triggers retraining at PSI >= 0.25).
Target Table: silver.feature_drift_stats (feature_name STRING, bucket STRING, actual_pct DOUBLE, expected_pct DOUBLE)
Verification & Architecture Insights
PSI is an internal engineering control threshold chosen by the data team; tracking it weekly catches covariate shift before credit default prediction accuracy degrades.