ML Governance Overview
The ML Governance module provides model explainability, fairness analysis, compliance auditing, and debugging capabilities for machine learning models deployed on the MATIH platform. These tools ensure that ML models are transparent, unbiased, auditable, and trustworthy in production environments.
Governance Framework
| Pillar | Component | Purpose |
|---|---|---|
| Explainability | SHAP/LIME integration | Understand why models make specific predictions |
| Fairness | Bias detection and mitigation | Ensure equitable outcomes across demographic groups |
| Compliance | Audit trail and documentation | Meet regulatory requirements (GDPR, CCPA, ECOA) |
| Debugging | Model inspection and diagnostics | Identify and resolve model issues |
Architecture
The governance module is implemented in data-plane/ml-service/src/ with dedicated services for each pillar:
| Service | Location | Key Class |
|---|---|---|
| Explainability | src/explainability/ | ModelExplainabilityService |
| Fairness | src/fairness/ | FairnessService |
| Compliance | src/compliance/ | ComplianceAuditService |
| Debugging | src/debugging/ | ModelDebuggingService |
Governance Workflow
- Model Registration: Model is registered with governance metadata
- Explainability Analysis: SHAP/LIME explanations generated for validation set
- Fairness Assessment: Bias metrics computed across protected attributes
- Compliance Documentation: Model card and audit report generated
- Approval: Governance review before production deployment
- Monitoring: Ongoing fairness and drift monitoring in production
API Endpoints
| Endpoint | Method | Purpose |
|---|---|---|
/api/v1/governance/explain | POST | Generate model explanations |
/api/v1/governance/fairness | POST | Run fairness assessment |
/api/v1/governance/audit | GET | Retrieve audit trail |
/api/v1/governance/model-card | GET | Get model documentation card |
/api/v1/governance/debug | POST | Run model diagnostics |
Governance Requirements by Model Stage
| Stage | Required Checks | Blocking |
|---|---|---|
| Staging | Feature importance, basic fairness metrics | No |
| Pre-production | Full SHAP analysis, fairness across all groups | Yes |
| Production | Ongoing drift monitoring, quarterly fairness audit | No |
Configuration
| Environment Variable | Default | Description |
|---|---|---|
GOVERNANCE_ENABLED | true | Enable governance module |
GOVERNANCE_REQUIRE_APPROVAL | true | Require governance approval for production |
GOVERNANCE_FAIRNESS_THRESHOLD | 0.8 | Minimum fairness ratio (80/20 rule) |
GOVERNANCE_EXPLAIN_SAMPLE_SIZE | 1000 | Samples for SHAP computation |
Detailed Sections
| Section | Content |
|---|---|
| Explainability (SHAP/LIME) | Feature importance, local explanations, visualization |
| Fairness and Bias | Demographic parity, equalized odds, bias mitigation |
| Compliance and Audit | Audit trails, model cards, regulatory reporting |
| Model Debugging | Error analysis, slice performance, counterfactuals |