agentsclimarketplace

Explainable ml healthcare

Skill rbr7/MedClawMini/skills/explainable-ml-healthcare

A focused, production-minded library of 197 clinical-AI and healthcare data-science skills for the OpenClaw agent platform featuring data quality, clinical NLP, big-data ML, explainable AI, drug safety, and regulatory.

Install
npx -y skills add rbr7/MedClawMini --skill explainable-ml-healthcare

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Explain and interpret machine-learning and deep-learning models on healthcare data. Covers global and local interpretability with SHAP and LIME, deep-network attribution (Integrated Gradients, attention, Grad-CAM for medical imaging), partial-dependence/ALE, counterfactuals, fairness/bias auditing across patient subgroups, and model cards. Use to make a clinical or operational model transparent and auditable, debug feature behavior, satisfy explainable-AI requirements, or build clinician trust.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

4.5 KB, as published. Nobody here has run it

Explainable ML for Healthcare

Overview

A healthcare model that cannot explain itself will not be trusted or deployed. This skill makes models from gradient-boosted trees to deep nets interpretable and auditable, covering both why this prediction (local) and how the model behaves (global), plus a fairness audit across patient subgroups. Explainability here is a first-class requirement, not an afterthought.

When to Use This Skill

  • Explaining individual predictions to clinicians or reviewers (case-level reasons).
  • Global feature-importance and behavior analysis for model debugging.
  • Interpreting deep-learning models (text, imaging, sequence) via attribution.
  • Auditing fairness/bias across age, sex, race/ethnicity, geography, or payer.
  • Producing model cards and documentation for ml-model-validation-regulatory.

Techniques

  1. SHAP Shapley-value attributions; TreeExplainer for boosted trees, DeepExplainer/ GradientExplainer for nets, KernelExplainer as a model-agnostic fallback. Global (beeswarm/bar) + local (waterfall/force).
  2. LIME local surrogate models for quick, model-agnostic case explanations.
  3. Deep-net attribution Integrated Gradients and attention for text/sequence; Grad-CAM saliency for medical images (pairs with imaging skills).
  4. Global behavior partial-dependence and ALE plots (ALE is robust to correlated features, common in clinical data); permutation importance.
  5. Counterfactuals minimal feature change to flip a decision ("what would lower this risk score").
  6. Fairness subgroup performance, calibration-within-group, and disparity metrics; report, don't hide, gaps.

Example

import shap, xgboost as xgb
model = xgb.XGBClassifier().fit(X_train, y_train)

explainer = shap.TreeExplainer(model)
sv = explainer(X_test)
shap.plots.beeswarm(sv)                      # global drivers
shap.plots.waterfall(sv[0])                  # one patient's explanation
# Deep model attribution with Integrated Gradients (Captum)
from captum.attr import IntegratedGradients
ig = IntegratedGradients(net)
attributions = ig.attribute(input_ids, baselines=baseline, target=1)

# Fairness: performance + calibration by subgroup
from sklearn.metrics import roc_auc_score
for g, idx in groups.items():
    print(g, "AUROC", round(roc_auc_score(y[idx], p[idx]), 3),
             "pos-rate", round(p[idx].mean(), 3))

Cautions

Interpret responsibly: SHAP/LIME show association, not causation; explanations can be unstable under correlated features (prefer ALE over PDP, TreeSHAP over KernelSHAP where possible); and a plausible-looking explanation of a biased model is still a biased model. Validate that explanations are stable and clinically sensible before showing them to users.

Outputs

  • global_importance.png + feature_importance.csv.
  • local_explanations/ per-case SHAP/LIME/IG artifacts.
  • fairness_audit.md subgroup metrics, calibration, disparities, recommendations.
  • model_card.md interpretability + fairness section for governance.

Healthcare Context

Targets the clinical trust and equity bar: case-level reasons clinicians can sanity-check, and explicit subgroup fairness because healthcare models can encode disparities. Consumes models from healthcare-predictive-modeling; feeds ml-model-validation-regulatory. Complements the repo's existing shap skill with healthcare framing, deep-net attribution, and fairness.

References

  • Lundberg & Lee (2017), A Unified Approach to Interpreting Model Predictions (SHAP).
  • Ribeiro et al. (2016), "Why Should I Trust You?" (LIME); Sundararajan et al. (2017), IG.
  • Mitchell et al. (2019), Model Cards; Captum https://captum.ai

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.