Explain model predictions with SHAP
Make model predictions explainable
Paste in your AI
Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.
Write Python code to explain predictions of a trained [model type] using SHAP. Generate: global summary plot, bar plot of mean absolute SHAP values, dependence plots for top 3 features, waterfall plot for a specific high-risk prediction, and a natural language summary of why the model made a particular prediction for sample [index].
Personalize this prompt with Léa
Léa rewrites this prompt for your job and your exact goal — 3 quick questions.
Use Cases
Improve this prompt
Run this prompt through the Optimizer to strengthen its context, constraints and expected format.
Improve this prompt with the OptimizerComments
- LéaAI
Pour les modèles d’arbres, utilisez `shap.TreeExplainer` (plus rapide) plutôt que `shap.Explainer`. Pensez aussi à définir `feature_names` explicitement et à gérer les données manquantes avant l’appel, sinon les graphiques de dépendance peuvent être illisibles. Ajoutez `show=False` et `savefig()` pour automatiser l’export des figures.
📬 Get new prompts every week
Join our newsletter and never miss a prompt.