This sub-repository contains both Python and R notebooks with models and analyses similar (but not 100% equal) to the results published in the tutorial "SHAP for Actuaries: Explain any Model" of M. Mayer, D. Meier, and M.V. Wüthrich.
- shap_tutorial.ipynb: Python notebook using the conda env specified in "environment.yml"
- shap_tutorial.Rmd: R Markdown file
Both codes use the following data:
The folder "rdata" contains the Parquet file "df.parquet", representing 1 mio rows of synthetic (but realistic) claims frequency data.
- Python: Click on the ipynb file
- R: shap.html (please click on this link to preview html output; in order to see the table of contents properly, download the html and open it in your browser.)