Skip to content

feat(governance): add SHAP explainability for segmentation predictions#29

Merged
Oshgig merged 1 commit into
developfrom
feature/governance-shap-explainability
May 3, 2026
Merged

feat(governance): add SHAP explainability for segmentation predictions#29
Oshgig merged 1 commit into
developfrom
feature/governance-shap-explainability

Conversation

@Goldokpa
Copy link
Copy Markdown
Member

Summary

  • Adds src/climatevision/governance/ module with SHAP-based explainability
  • Implements SHAPExplainer class using DeepExplainer with gradient fallback
  • Adds /api/explain and /api/explain/{run_id} API endpoints
  • Creates notebooks/06_explainability.ipynb with visualization examples
  • Adds shap>=0.42.0 to requirements.txt

Key Features

  • Band-level attribution: Shows which spectral bands (Red, Green, Blue, NIR) drove the prediction
  • Spatial importance: Heatmap showing which image regions mattered most
  • API integration: REST endpoints for generating explanations on-demand

Test plan

  • Run python -c "from climatevision.governance import SHAPExplainer; print('OK')"
  • Start API and test POST /api/explain endpoint
  • Execute notebooks/06_explainability.ipynb cells
  • Verify heatmap generation saves to outputs/explanations/

Closes #22

🤖 Generated with Claude Code

- Add governance module with SHAPExplainer class
- Implement band-level and spatial attribution using DeepExplainer
- Add /api/explain endpoint for SHAP-based explanations
- Create 06_explainability.ipynb with visualization examples
- Add shap>=0.42.0 to requirements.txt

Closes #22

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

3 participants