https://github.com/yingding/kaggle-munich
the notebook for Kaggle Munich SHAP 101 talk
https://github.com/yingding/kaggle-munich
Last synced: about 1 month ago
JSON representation
the notebook for Kaggle Munich SHAP 101 talk
- Host: GitHub
- URL: https://github.com/yingding/kaggle-munich
- Owner: yingding
- License: apache-2.0
- Created: 2023-04-12T19:48:03.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-12T21:23:17.000Z (over 3 years ago)
- Last Synced: 2025-11-16T04:04:34.350Z (8 months ago)
- Language: Jupyter Notebook
- Size: 1.45 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kaggle-munich
the notebook for Kaggle Munich SHAP 101 talk
# Introduction into SHAP
SHAP trains an additional model based on the observation of custom model behaviour to determine how black box custom model making decision regarding the input features.
## Create a virtual environment
For macosx apple silicon
```shell
/opt/homebrew/bin/python3.10 -m venv ~/VENV/shap3.10
```
## Install packages
```shell
source ~/VENV/shap3.10/bin/activate
python3 -m pip install -r requirements.txt --no-cache
deactivate
```
## Add a jupyter notebook kernel to VENV
```console
source ~/VENV/shap3.10/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install ipykernel
deactivate
```
We need to reactivate the venv so that the ipython kernel is available after installation.
```
source ~/VENV/shap3.10/bin/activate
# ipython kernel install --user --name=shap3.10
python3 -m ipykernel install --user --name=shap3.10 --display-name "shap3.10"
```
Note:
* restart the vs code, to select the venv as jupyter notebook kernel
* name is `shap3.10`, which is the venv name.
Reference:
* https://ipython.readthedocs.io/en/stable/install/kernel_install.html
* https://anbasile.github.io/posts/2017-06-25-jupyter-venv/
## Remove ipykernel
```shell
# jupyter kernelspec uninstall -y
jupyter kernelspec uninstall -y shap3.10
```
## Remove all package from venv
```
python3 -m pip freeze | xargs pip uninstall -y
python3 -m pip list
```