Back to Blog
Machine Learning January 10, 2025 7 min read

SHAP for Production ML: Explaining Models to Non-Technical Stakeholders

A practical guide to SHAP values — global importance, local explanations, waterfall plots, and how to turn model explanations into business insights.

Why SHAP?

SHAP (SHapley Additive exPlanations) gives theoretically grounded feature importance — not the biased impurity importance from tree models.

Three Key Plots

1. Beeswarm (Global)

import shap
explainer = shap.TreeExplainer(model)
shap_values = explainer(X_test)
shap.plots.beeswarm(shap_values)

2. Waterfall (Local — one prediction)

shap.plots.waterfall(shap_values[0])

3. Dependence Plot

shap.plots.scatter(shap_values[:, 'TransactionAmt'])

Stakeholder-Friendly Framing

"This transaction was flagged as fraud because the amount ($3,200) is 4x higher than typical for this card, and the email domain changed in the last 24h."

SHAPExplainabilityXAIFeature ImportanceProduction
O

Ossama Elhakki

AI Engineer & ML Systems Builder — Morocco