Guide: Explainability (XAI)
Attach SHAP/LIME values to each decision so auditors can see why the model decided.
Capture SHAP/LIME
xai.pypython
record = client.records.create(
model_id="credit-model-v2",
input={"income": 85000, "debt_ratio": 0.32, "credit_score": 720},
output={"decision": "APPROVED", "limit": 25000},
confidence=0.94,
explanation={
"method": "SHAP",
"values": {"income": 0.35, "debt_ratio": -0.28, "credit_score": 0.22}
}
)Bundle Artifact
explanation.jsonjson
explanation.json
{
"method": "SHAP",
"values": {
"income": 0.35,
"debt_ratio": -0.28,
"credit_score": 0.22
},
"version": "1.0.0"
}For deterministic explanations, pin data preprocessing versions and model versions (see Model Cards).