Skip to content

feat: explainability (permutation + SHAP) and integrity fixes#9

Merged
ancongui merged 2 commits into
mainfrom
feat/explainability-and-integrity
Jun 25, 2026
Merged

feat: explainability (permutation + SHAP) and integrity fixes#9
ancongui merged 2 commits into
mainfrom
feat/explainability-and-integrity

Conversation

@ancongui

Copy link
Copy Markdown
Contributor

First verified increment from a full-codebase gap audit (95 gaps found; this PR delivers the flagship feature + the highest-impact integrity fixes). Everything here is tested on real data — no fakes.

Explainability (new hexagonal module — the headline gap)

  • ExplainerPort + typed GlobalExplanation / LocalExplanation.
  • PermutationImportanceExplainer — dependency-free default (scikit-learn).
  • ShapExplainer — optional explain extra; global + local (per-prediction) attributions.
  • ExplainabilityAutoConfiguration — SHAP when the extra is installed, else permutation.
  • AutoMLResult.explain(dataset) + DI wiring via AutoML.from_context.
  • 4 real-data TDD tests: permutation ranks a genuine feature above an injected pure-noise column; AutoML integration; DI auto-config; SHAP global+local.
  • docs/explainability.md with real permutation-importance output + nav/homepage cards.

Integrity fixes (so the docs match the code — "no fake data")

  • Plain AutoML() now includes installed XGBoost/LightGBM/CatBoost by default, matching the documented "+ boosting when installed" (previously only the DI/agentic path did). TDD-covered.
  • security.md: the sandbox tiers (docker/e2b), timeout_seconds, and HITL require_approval are now clearly marked declared-config / roadmap — only Layers 1–2 (static analysis + restricted in-process exec) are enforced today. The cost-benefit gate is corrected to a post-hoc measured-lift filter (it was described as a pre-call budget governor; budget_usd is not yet enforced).
  • README: distinguishes shipping adapters from reference/planned ones (AutoGluon, Feast, BentoML packaging, model registry).

Verified for real

  • Full affected-path suite green (explainability, AutoML defaults, serving, DI). Lint clean; mkdocs build --strict clean.
  • Real-LLM end-to-end (Claude haiku-4-5): GenAI feature engineering accepted measured-lift features and rejected the rest; the agentic loop verified 9 attempts.

Not in this PR (tracked backlog, next increments)

Calibration · stacking · pluggable CV (stratified/group/time) · class-imbalance + PR-AUC · drift/monitoring · fairness/bias · model cards · CLI train/predict/explain · data profiling · wiring GenAI feature-engineering into AutoML.fit · actually enforcing the sandbox/approval tiers.

Andres Contreras added 2 commits June 25, 2026 19:45
…ixes

Explainability (new domain module, hexagonal):
- ExplainerPort + typed GlobalExplanation/LocalExplanation
- PermutationImportanceExplainer (dependency-free default) + ShapExplainer
  (optional 'explain' extra: global + local attributions)
- ExplainabilityAutoConfiguration (SHAP when installed, else permutation)
- AutoMLResult.explain() + DI wiring via AutoML.from_context
- 4 real-data TDD tests (signal>noise, AutoML integration, DI, SHAP)
- docs/explainability.md (real permutation-importance output) + nav/home cards

Integrity / no-fake-data fixes (from a full-codebase gap audit):
- plain AutoML() now includes installed XGBoost/LightGBM/CatBoost by default,
  matching the documented '+boosting when installed' (TDD)
- security.md: sandbox tiers (docker/e2b), timeout_seconds and HITL approval
  marked as declared-config/roadmap (only static-analysis + restricted exec are
  enforced today); cost-benefit gate corrected to a post-hoc measured-lift filter
- README: list real adapters vs reference/planned (AutoGluon/Feast/BentoML)

Real-LLM path verified end-to-end (Claude haiku-4-5): gate accepts measured-lift
features, rejects the rest; agentic loop verifies 9 attempts.
- AdapterUnavailableError(adapter, extra) two-arg form; shap import marked
  type-ignore[import-not-found] (CI doesn't install the explain extra)
- cast untyped sklearn permutation_importance / shap returns to Any
- apply ruff format
@ancongui ancongui merged commit 83883d2 into main Jun 25, 2026
4 checks passed
@ancongui ancongui deleted the feat/explainability-and-integrity branch June 25, 2026 18:02
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.

1 participant