Questions tagged [shapley]
15 questions
20
votes
6 answers
Numba needs NumPy 1.20 or less for shapley import
I am trying to import shap. I am getting the following bug. I installed the lower version of NumPy still the problem is not solved. Thank you!
import shap
ImportError Traceback (most recent call…

user3064366
- 1,509
- 2
- 11
- 15
1
vote
1 answer
How to plot all features in SHAP summary plot? How to include the SHAP values in the summary plot?
I am currently trying to plot a set of 29 features on a SHAP summary plot. However, I am struggling to find the code necessary to do so.
I want to plot the result of the Neural Network model using SHAP and I am using Python. I have 29 predictor…

Ellie Moh
- 11
- 2
1
vote
1 answer
Cartopy Splitting Large Circle
I am trying to plot the visible region of the sky from Denver, CO, and show this region as a shaded "circle" on a map projection.
I'm expecting a distorted circle (because of map projections) on the map, centered on Denver. When I try to plot the…

DoomedJupiter
- 73
- 7
1
vote
1 answer
Shapley values for glmnet using R's iml package
I'm unable to use the iml package in R to find shapley values for glmnet models.
It seems like the problem might be related to the fact that glmnet() and predict.glmnet() expect matrices, while the x.interest argument in iml::Shapley$new() expects a…

infinitefactors
- 144
- 6
1
vote
0 answers
Shapley values for the three clusters by cluster number KMeans algorithm
I am trying to replicate this https://cast42.github.io/blog/datascience/python/clustering/altair/shap/2020/04/23/explain-clusters-to-business.html#Kmeans-clustering
But using R and not Python as in the article.
What I haven't managed to get is the…

Anne
- 109
- 5
0
votes
1 answer
I have a python error for numpy implementation for a shapley value model
I want to insert this code into my python
import random
import warnings
import numpy as np
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from…

ulissebu123
- 19
- 3
0
votes
0 answers
geopandas.GeoPandasDataFrame.from_postgis() raises "Unknown WKB type 41"
I am struggeling with the following issue:
While running my Python3.8.10 interpreter with Jupyter Notebook (setting A), I can successfully connect to my Postgis database and query the data while writing it to geopandas.GeoDataFrame. For that, I use…

Kabrüggen
- 1
- 1
0
votes
0 answers
shapley values - error on dimensions of the data
I get the following error when running my code using shap for my CNN model: AssertionError: AssertionError:Instance must have 1 or 2 dimensions!` - I would appreciate any advice
Using 1484 background data samples could cause slower run times.…
0
votes
0 answers
What are the formats of Xall and Xset data in sensitivity package?
An example of sensitivity package is shown below, how I will implement shapleyPermEx with my data.
Xall <- function(n) matrix(runif(d*n,-pi,pi),nc=d)
Xset <- function(n, Sj, Sjc, xjc)…

TUSTLGC
- 107
- 7
0
votes
0 answers
Random Forest and SHAP values with few features for features selection
I have some datasets with 4 features and observations between 100 and 300. I would like to use them to perform a classification. The target variable has 3 possible labels. I have trained a Random Forest and as the interpretation and understanding of…

Pachita
- 3
- 2
0
votes
0 answers
In SHAP TreeExplainer, when feature_pertrubation='tree_path_dependent' but data is not None, do we have 'interventional' shap?
So when feature_pertrubation='tree_path_dependent' the data argument is optional. If we give a background dataset, do we have the same behaviour as if feature_pertrubation='interventional?
From my minimal example that's what it seems like, at least…

Kyriacos Xanthos
- 55
- 1
- 7
0
votes
0 answers
Elimination of need to retrain models in "Shaply Sampling Values"
While reading the paper "A Unified Approach to Interpreting Model
Predictions" by Lundberg and Lee (https://proceedings.neurips.cc/paper/2017/file/8a20a8621978632d76c43dfd28b67767-Paper.pdf), on page 3 I see:
Shapley sampling values are meant to…
0
votes
1 answer
How to interpret the Shapley formula
For the Shapley equation
How to read ??
I know the first part says F is a subset of S, but what does the \{i} mean?

Joe
- 357
- 2
- 10
- 32
0
votes
0 answers
Using SHAP: Scaling the Shapley values for each model and then averaging across models, or just adding the Shapley values for each model?
I'm running n trials on a Keras model with k features, after which I apply SHAPs DeepExplainer to the model on each trial. All the data is the same, but it is randomly split between the training and testing sets. I'm trying to figure out the best…

Brian Droncheff
- 69
- 7