Build a model debugging toolkit with error analysis, confusion analysis, and model failure mode identification.
## Files to modify
- astroml/training/debugging/error_analysis.py
- astroml/training/debugging/confusion_analysis.py
- astroml/training/debugging/failure_modes.py
- astroml/training/debugging/slice_analysis.py
- astroml/api/routers/debugging.py
## Out of scope
- Refactoring unrelated modules
- Changing public API contracts
- Major version bumps or breaking changes
- Performance optimizations not directly related to the issue
## Acceptance criteria
- [ ] Code changes implemented as per procedure steps
- [ ] All new code has complete type hints
- [ ] Unit tests added/updated with >90% coverage for changed code
- [ ] All tests pass: pytest tests/
- [ ] Linting passes: pre-commit run --all-files
- [ ] Documentation updated if needed
- [ ] Changes reviewed and approved
## Procedure
1. Implement error analysis with confusion matrices
2. Build slice-based performance analysis
3. Add failure mode identification
4. Implement feature attribution for errors
5. Create model debugging dashboard
6. Add automated error report generation
7. Implement comparison with baseline models
8. Test with various error scenarios
Description