Skip to content

xyonix/shap-values-titanic-xyonix-blog

Repository files navigation

shap-values-titanic-xyonix-blog

SHAP values are used to explain model outcomes predicting passenger survival on the RMS Titanic

installation

# create an environment, install packages, register Jupyter kernel and launch notebook
python3 -m venv xyonix_titanic && source xyonix_titanic/bin/activate
pip install --upgrade pip setuptools wheel
pip install ipykernel shap xgboost matplotlib seaborn Jinja2 ipywidgets
jupyter nbextension enable --py widgetsnbextension --sys-prefix
python -m ipykernel install --user --name xyonix_titanic
jupyter notebook

Once the Jupyter notebook navigator loads:

  1. Select shap_values_titanic_xyonix_blog.ipynb to open notebook
  2. Select Kernel >> Change kernel >> xyonix_titanic from pulldown menu

notebook

The Jupyter Notebook corresponds to the XYONIX article, Explaining a Passenger Survival AI Model Using SHAP for the RMS Titanic. Run the cells in the notebook in order to produce the plots shown in the article, such as the SHAP force layout plots shown below.

shap value force layout plots for select passengers

About

SHAP values are used to explain model outcomes predicting passenger survival on the RMS Titanic

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published