SHAP values are used to explain model outcomes predicting passenger survival on the RMS Titanic
# 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:
- Select
shap_values_titanic_xyonix_blog.ipynbto open notebook - Select
Kernel >> Change kernel >> xyonix_titanicfrom pulldown menu
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.
