shap Questions

2

Solved

I have built a dashboard in streamlit where you can select a client_ID and have SHAP plots displayed (Waterfall and Force plot) to interpret the prediction of credit default for this client. I also...
Maymaya asked 27/8, 2021 at 9:2

1

In a typical Shapley value estimation for a numerical regression task, there is a clear way in which the marginal contribution of an input feature i to the final numerical output variable can be ca...
Laughingstock asked 4/2, 2022 at 14:59

2

Solved

How do we make sense of SHAP explainer.expected_value? Why is it not the same with y_train.mean() after sigmoid transformation? Below is a summary of the code for quick reference. Full code availab...
Alejoa asked 18/9, 2023 at 9:28

5

I cannot use PyTorch and Shap getting this error PyTorch Error loading "\lib\site-packages\torch\lib\shm.dll" or one of its dependencies. I have tried to uninstall and re-install PyTorc...
Recalesce asked 27/11, 2022 at 22:24

3

I am trying to plot a grid of dependence plots from the shap package. Here is MWE code for an example of what I want: fig, axs = plt.subplots(2,8, figsize=(16, 4), facecolor='w', edgecolor='k') # ...
Mohl asked 22/10, 2019 at 18:4

3

I am dealing with a Regression problem and I used StackingRegressor to train data and then make prediction on test set. For model explainability purpose, I used SHAP as follows: import xgboost from...
Lavena asked 14/2, 2022 at 19:31

4

I am trying to create shap values for a single row for the local explanation but I am consistently getting this error. I tried various methods but still couldn't able to fix them. Things I did so f...
Lipocaic asked 3/7, 2021 at 5:21

6

Solved

I have the following dataframe: import pandas as pd import random import xgboost import shap foo = pd.DataFrame({'id':[1,2,3,4,5,6,7,8,9,10], 'var1':random.sample(range(1, 100), 10), 'var2':ran...
Huckleberry asked 5/4, 2022 at 14:21

2

Solved

I am trying to plot SHAP This is my code rnd_clf is a RandomForestClassifier: import shap explainer = shap.TreeExplainer(rnd_clf) shap_values = explainer.shap_values(X) shap.summary_plot(shap_va...
Shallop asked 3/1, 2021 at 12:0

3

Solved

Is there any way that I can change the shap plot background color or text color in the dark theme? I need either the white background or white text. The plot is an object of IPython.core.display...
Davena asked 15/2, 2020 at 12:42

2

Solved

For the code given below, if I just use the command shap.plots.waterfall(shap_values[6]) I get the error 'numpy.ndarray' object has no attribute 'base_values' I have to firstly run these two comm...
Winterfeed asked 15/8, 2022 at 4:28

1

Solved

I'm new to using shap, so I'm still trying to get my head around it. Basically, I have a simple sklearn.ensemble.RandomForestClassifier fit using model.fit(X_train,y_train), and so on. After traini...
Mako asked 1/9, 2022 at 10:59

1

Solved

For the code given below, I am getting different bar plots for the shap values. In this example, I have a dataset of 1000 train samples with 9 classes and 500 test samples. I then use the random fo...
Adit asked 12/8, 2022 at 4:17

1

I haven't been able to find much in the way of examples on SHAP values with PyTorch. I've used two techniques to generate SHAP values, however, their results don't appear to agree with each other. ...
Padraig asked 28/12, 2021 at 17:14

1

For a particular prediction problem, I observed that a certain variable ranks high in the XGBoost feature importance that gets generated (on the basis of Gain) while it ranks quite low in the SHAP ...

1

Solved

I tried to use Shap (Tree Explainer) for sklearn.ensemble._stacking.StackingClassifier explainer = shap.TreeExplainer(clf) shap_values = explainer.shap_values(x) shap.initjs() return shap.force_plo...

1

Solved

My model uses LGBMClassifier. I'd like to use Shap (Shapley) to interpret features. However, Shap gave me errors on categorical features. For example, I have a feature "Smoker" and its va...
Donalt asked 14/5, 2022 at 13:45

1

samples.zip The sample zipped folder contains: model.pkl x_test.csv To reproduce the problems, do the following steps: use lin2 =joblib.load('model.pkl') to load the linear regression model use ...
Riyal asked 28/6, 2021 at 22:17

1

Solved

I want to do a simple shap analysis and plot a shap.force_plot. I noticed that it works without any issues locally in a .ipynb file, but fails on Databricks with the following error message: Visual...
Bac asked 4/5, 2022 at 12:12

5

Solved

When displaying summary_plot, the color bar does not show. shap.summary_plot(shap_values, X_train) I have tried changing plot_size. When the plot is higher the color bar appears, but it is very s...
Monjo asked 23/12, 2021 at 11:48

2

Solved

The Paper regarding die shap package gives a formula for the Shapley Values in (4) and for SHAP values apparently in (8) Still I don't really understand the difference between Shapley and SHAP valu...
Pimple asked 2/10, 2019 at 14:21

2

I am trying to build a catboost model within the tidymodels framework. Minimal reproducible example is given below. I am able to use the DALEX and modelStudio packages to get model explanations but...
Nosepiece asked 5/3, 2022 at 5:5

1

Solved

This question refers to Obtaining summary shap plot for catboost model with tidymodels in R. Given the comment below the question, the OP found a solution but did not share it with the community so...
Keefe asked 29/3, 2022 at 12:36

1

Solved

I am working on a binary classification using random forest and trying out SHAP to explain the model predictions. However, I would like to convert the SHAP local explanation plots with values into ...

3

Solved

I need to plot how each feature impacts the predicted probability for each sample from my LightGBM binary classifier. So I need to output Shap values in probability, instead of normal Shap values. ...
Symbolist asked 12/3, 2022 at 0:43

© 2022 - 2025 — McMap. All rights reserved.