Skip to content

feat(governance): add regional bias audit framework for model fairness#30

Merged
Goldokpa merged 1 commit intodevelopfrom
feature/governance-bias-audit
May 5, 2026
Merged

feat(governance): add regional bias audit framework for model fairness#30
Goldokpa merged 1 commit intodevelopfrom
feature/governance-bias-audit

Conversation

@Goldokpa
Copy link
Copy Markdown
Member

Summary

  • Adds BiasAuditor class for evaluating model fairness across geographic regions
  • Implements three fairness metrics: demographic parity, equalized odds, predictive parity
  • Creates scripts/audit_model.py CLI tool for running audits
  • Adds notebooks/07_bias_audit.ipynb with visualization examples
  • Supports regions: Amazon, Congo, Southeast Asia, Boreal

Key Features

  • Per-region metrics: IoU, F1, precision, recall, TPR, FPR
  • Fairness scoring: Detects disparate performance across regions
  • CI/CD integration: check_fairness_gate() returns True/False for pipeline gating
  • Automated recommendations: Suggests improvements for underperforming regions

Usage

# Run full audit
python scripts/audit_model.py --model models/best_model.pth --regions amazon,congo

# CI gate mode (exit 1 if fails)
python scripts/audit_model.py --model models/best_model.pth --ci-gate --threshold 0.85

Test plan

  • Run python -c "from climatevision.governance import run_bias_audit; print('OK')"
  • Execute python scripts/audit_model.py --list-regions
  • Execute notebooks/07_bias_audit.ipynb cells
  • Verify reports save to outputs/bias_reports/

Closes #23

🤖 Generated with Claude Code

- Add BiasAuditor class with demographic parity, equalized odds, and predictive parity metrics
- Implement run_bias_audit() for evaluating model fairness across regions
- Add check_fairness_gate() for CI/CD integration
- Create scripts/audit_model.py CLI tool for running audits
- Add notebooks/07_bias_audit.ipynb with visualization examples
- Support Amazon, Congo, Southeast Asia, and Boreal forest regions

Closes #23

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Goldokpa Goldokpa force-pushed the feature/governance-bias-audit branch from 8bfe292 to 61d464e Compare May 5, 2026 22:49
Copy link
Copy Markdown
Collaborator

@obielin obielin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for picking this up while I was finishing the explainability work — the regional bias auditor with demographic-parity / equalized-odds support is exactly what the governance pipeline needs upstream of the CI gate I shipped in #39.

After the rebase the PR landed cleanly on top of my anomaly detector / audit logger / model card / LLM reporter — governance/__init__.py re-exports all of them coherently. The fairness gate function plugs straight into scripts/governance_ci_gate.py. Approving and happy to take ownership going forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants