Skip to content

ab93/explainable-ml-shap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Beyond the Black Box: Interpreting ML Models with SHAP

Materials from PyData Berlin 2025 talk on model interpretability using SHAP (SHapley Additive exPlanations).

Overview

This repository contains code and slides demonstrating how to use SHAP for explaining machine learning models across different domains:

Case Study 1: XGBoost classifier on tabular banking data Case Study 2: 1D CNN on time series sensor data for human activity recognition

Quick Start

  1. Clone the repo
git clone https://github.com/ab93/explainable-ml-shap.git
cd explainable-ml-shap
  1. Install dependencies using Poetry
poetry install -v
  1. Open the notebooks
jupyter notebook

Case Studies

Bank Marketing (XGBoost + TreeSHAP)

  • Dataset: Portuguese bank direct marketing campaigns
  • Task: Predict term deposit subscription (binary classification)
  • Model: XGBoost Classifier (AUC: 0.79)
  • Explanation: TreeSHAP for fast, exact explanations

Human Activity Recognition (CNN + DeepSHAP)

  • Dataset: Smartphone sensor data (accelerometer + gyroscope)
  • Task: Classify 6 human activities (multiclass classification)
  • Model: 1D CNN with PyTorch
  • Explanation: DeepSHAP for neural network interpretability

Citing

If you want to cite my work, please cite the paper:

@article{Basu2025ExplainingMP,
  title={Explaining ML predictions with SHAP},
  author={Avik Basu},
  journal={Proceedings of the Python in Science Conference},
  year={2025},
  url={https://api.semanticscholar.org/CorpusID:282192526}
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published