Questions tagged [shap]
The shap tag has no usage guidance.
67
questions
0
votes
0
answers
12
views
Kernel SHAP loss function
I'm a beginner at data science and currently learning for XAI using Kernel SHAP method.
After reading the official paper, I've found this formula to implement Kernel SHAP :
(I'm aware there are shap ...
0
votes
0
answers
15
views
TreeSHAP algorithm: how do UNWIND and EXTEND work?
In the paper Consistent Individualized Feature Attribution for Tree Ensembles, the authors describe the well-known TreeSHAP algorithm.
It aims to calculate the SHAP values of feature $i$ for all $i$ ...
1
vote
1
answer
22
views
shapley graph plot via python
Does anybody know how can we plot this graph? Sth like attached.
0
votes
0
answers
31
views
Can I decompose SHAP interaction values like a linear regression?
I had a question regarding the shap interaction matrix.
Suppose I have 500 samples with 2 features. Then my interaction matrix becomes (500,2,2).
I want to calculate the SHAP values of each feature ...
0
votes
1
answer
46
views
Why does the SHAP library in python seem to be so poorly coded/maintained, and how do I get a working environment?
I suppose this is a general question involving dependency conflicts. Without fail, every time I attempt to include the shap library into my project to examine explainability, it creates python ...
0
votes
1
answer
71
views
Can using the mean of absolute Shapely Values for feature importance give very wrong results?
In a classification problem, suppose a model has 2 variables, A and B, and the null model (the model without any variable) predicts 50% probability for belonging to class 1 for all the instances.
Now ...
1
vote
1
answer
130
views
Why the marginal contribution of a feature is the difference between the feature effect minus the average effect
In several sources the marginal contribution is defined as
the difference between the prediction with and without the feature.
However, recently I read an article where the marginal contribution was ...
1
vote
1
answer
98
views
Can we add baseline to SHAP?
I have a doubt. I am currently using an integrated gradient for the DNN model for explainability. In that, we can specify the baseline as a parameter to the function. I am using all zeros for this. I ...
0
votes
1
answer
261
views
Shapley Values - How to interpret each value for each feature for a specific instance?
I am using Shap Values(the 'shap' module in python) to help me understand a bit better the relation between my features and my target. I am currently working on a binary classification problem.
I know ...
2
votes
0
answers
158
views
Capturing the 'direction' of feature importances using TreeSHAP?
I'm a machine learning / python novice, so apologies if my question is simple, but I haven't been able to find it addressed.
I'm very interested in using ML to determine the most important features ...
0
votes
0
answers
32
views
Can you use shap. to get importance score for learned (CNN) filters
It is possible to get the "importance" scores for intermediate features (not direct input components) of a trained model using SHAP tools: https://shap.readthedocs.io/en/latest/. From I can ...
0
votes
2
answers
2k
views
Shap summary Plot for binary classification and multiclass
For binary classification, I am getting only a unicolor feature importance plot (i.e., the two classes do not appear individually).
However, for multiclass, I am getting feature importance in ...
0
votes
0
answers
22
views
SHAP explainability with RASA
My Rasa is not giving right predictions in many cases, and I want to toubleshoot what keywords are causing wrong classifications. So planning to use SHAP explain-ability with rasa nlu models.
Will it ...
0
votes
0
answers
93
views
Can I fit my model on whole dataset without splitting it to train and test sets to get SHAP values?
I have a small dataset with 297 sample, before using SHAP technique you must have a fitted model, can I fit my model on whole dataset and use it for SHAP technique?
I don't want split my dataset to ...
0
votes
0
answers
37
views
how do i explain my model using shap
I am trying to explain my shap using shape tools, but it doesn't work. I am using ImageDataGenerator to augments my dataset images.
...
0
votes
0
answers
88
views
SHAP: How can interpret a certain feature has positive or negative impact correctly?
I want to raise a question here already I created an issue in the related workaround but still haven't gotten any clarification about it.
I also want to tag most related posts I found: post1 & ...
0
votes
0
answers
153
views
How to interpret the Shapley values returned by TreeShap for multiclass classification?
I have read in Molnar (2022) and Gianfagna (2021) books that the TreeShap method returns the exact Shapley values of Shapley (1951).
The Shapley value estimates, given the current set of feature ...
0
votes
0
answers
61
views
Using mean absolute SHAP values as input into UMAP
Imagine you have a data set and you calculate SHAP values to understand feature importance. You then calculate the mean absolute SHAP values, as per this bar chart in the Interpretable ML book.
If you ...
2
votes
2
answers
298
views
What is the difference (interpretation) between the partial R^2 and the SHAP value for a linear regression model?
To calculate the coefficient of partial determination R2 for a given variable:
We calculate the R2 with and without that variable and substract them. This implies fitting a different model with and ...
0
votes
0
answers
11
views
how to effectively select "locally" important variables in regression (like an imbalanced variable with a lot of zeros and few 1)
so I have situations where there are some variables which I know are relevant from a business perspective which might decrease variance on a part of the dataset. example: while estimating cars values, ...
1
vote
1
answer
545
views
How can SHAP feature importance be greater than 1 for a binary classification problem?
Let's say I build a binary classification model to predict survival on the Titanic. I then use SHAP to get feature importance for each feature. I see that the SHAP importance for the top feature, <...
2
votes
1
answer
191
views
Can you do the math for this simple treeSHAP example (decisionTree)?
[EDIT] The question now has been solved, I updated the calculations bellow.
I've been trying to understand the math behind shap values. So far I understand all the concepts in SHAP but not to get to ...
0
votes
1
answer
962
views
Error getting prediction explanation using shap_values when using scikit-learn pipeline?
I am building an NLP model to predict language type (C/C++/C#/Python...) for a given code.
Now I need to provide an explanation for my model prediction. For example the following user_input is written ...
3
votes
1
answer
390
views
Is multicollinarity a problem when interpreting SHAP values from an XGBoost model?
I'm using an XGBoost model for multi-class classification and is looking at feature importance by using SHAP values. I'm curious if multicollinarity is a problem for the interpretation of the SHAP ...
0
votes
0
answers
31
views
Can we use an independent t-test as a metric for feature importance?
I have a supervised binary classification problem. I tuned an xgboost model on the training set and achieved a reasonably high accuracy on the test set. Now I want to interpret the results of the ...
1
vote
0
answers
64
views
references on how to use shap values without the shap package
I am familiar with the shap python package and how to use it, I also have a pretty good idea about shap values in general, but it is still new to me. What I'm requesting are references (ideally python ...
2
votes
0
answers
694
views
Sample size for SHAP explainer and range of a SHAP value
I am working on a binary classification with 977 records with 77:23 class proportion. I used random forest model.
Based on my attempt to run SHAP package, I got the below plots
And I also see that ...
2
votes
1
answer
3k
views
How to interpret SHAP summary plot?
I already referred these posts here and here. So, please don't mark it as duplicate
I am doing a binary classification using random forest and class labels are 1 and 0. What is the likelihood that ...
1
vote
1
answer
502
views
Are predictive features with 0 SHAP values included in the model?
I have trained and XGBoost by enforcing no-feaure interaction and calculated Global Shap values:
It looks like only 6 features have some SHAP values, whilst the remaining ones have a SHAP value of 0.
...
0
votes
0
answers
591
views
Why are SHAP values not an indication of cause?
I have trained an XGBoost Classifier and I am now trying to explain how and, most importantly, why the model has made the predictions it's made.
In the documentation entry Be careful when interpreting ...
1
vote
0
answers
180
views
Do monotonic constraints prevent an XGboost to capture non-linear relationships in the data?
I have trained an XGBoost model (for a binary classification problem) and I have tested two scenarios:
Scenario 1 - No Monotonic Constrained applied
In this case I get a Gini on the training sample of ...
3
votes
0
answers
1k
views
Differences between Feature Importance and SHAP variable importance graph
I have run an XGBClassifier using the following fields:
...
0
votes
1
answer
150
views
What is the SHAP values for a liner model? How do we derive that?
What is the SHAP values for a linear model?
it is given as below in the documentation
Assuming features are independent leads to interventional SHAP values which for a linear model are coef[i] * (x[i]...
1
vote
0
answers
293
views
Using SHAP values as features in a classification problem
I'm looking for feedback on a methodology I've tried that has yielded strange results.
Problem background:
supervised multi-class classification problem for which I've used a random forest to create ...
1
vote
0
answers
175
views
Samples to use when calculating SHAP values
I'm new to data science and I'm learning about SHAP values to explain how a Random Forest model works.
I have an existing RF model that was trained on tens of millions of samples over a few hundred ...
0
votes
0
answers
88
views
meaning of shapley values using SHAP
I have a binary classification - "BAD" and "GOOD" samples.
The features are binary as well, either 0 or 1 (each sample is a boolean vector of size 264. I got about 3000 "BAD&...
0
votes
1
answer
2k
views
Shap after scikit pipeline - feature name
I'm using pipeline to transform data and predict model and I want to apply SHAP after that. However, when I apply it, it returns SHAP chart just fine, but the name of the feature are like feature 1, ...
2
votes
0
answers
198
views
Shapley values for channel attribution equal to linear attribution
I am looking into Shapley values for online marketing attribution. In recent time many articles seem to have been made on this particular approach to attribution (there are more):
https://medium.com/...
0
votes
1
answer
302
views
BorutaShap implementation
I want to use BorutaShap for feature selection in my model. I have my train_x as an numpy.ndarray and I want to pass it to the ...
2
votes
2
answers
5k
views
difference between feature effect and feature importance
Is there a difference between feature effect (eg SHAP effect) and feature importance in machine learning terminologies?
0
votes
2
answers
307
views
aggregation of feature importance
I have more of a conceptual question I was hoping to get some feedback on. I am trying to run a boosted regression ML model to identify a subset of important predictors for some clinical condition. ...
1
vote
1
answer
276
views
Shapley value, conditional expectation vs reference point
In Shapley, the marginal contribution of a feature is computed by comparing the performance of a model with and without a feature over all possible subsets of features.
A common choice is using the ...
1
vote
0
answers
61
views
How marginal contributions of adding a variable in a model is calculated in determining SHAP feature importance?
I was trying to find feature importance using SHAP values in python for Isolation Forest. SHAP calculates the feature importance of a feature($i$) pertaining to a model($f$) for a datapoint($x$) using ...
1
vote
0
answers
271
views
SHAP for Deep Neural Network taking long time
I have 60,000 samples with each having 1,800 features. I have made a multilayer perceptron in Keras and I want to use SHAP values to arrive at global feature importance. Is the matrix too big for SHAP?...
2
votes
1
answer
3k
views
How can interparet shap.summary_plot and its gray color concerning outliers/anomaly?
I inspired by this notebook, and I'm experimenting IsolationForest algorithm using scikit-learn==0.22.2.post1 for anomaly ...
1
vote
0
answers
41
views
not getting point predictions from sagemaker clarify [closed]
I wanted to create shap values for my predictions in sagemaker. I found out that I can use "clarify" functionality in sagemaker to get shap values. However, I want to get point predictions ...
2
votes
0
answers
207
views
Shapley summary plot interpretation doubt?
I have question when interpreting SHAP summary plot. I have attached the sample plot
Here, If I am interpreting it correctly, low values of feature 1 are associated with high and negative values for ...
0
votes
0
answers
2k
views
How to tell which class is which with SHAP values in a summary plot?
I ran a random forest classifier to predict pollen color based on various environmental variables. The possible predictions are purple or yellow. I want to run a summary plot in shapely to get an ...
2
votes
0
answers
687
views
How SHAP value explains contribution of features for outliers event?
I'm trying to understand and experiment with how the SHAP value can explain behaviour for each outlier events (rows) and how it can be related to shap.force_plot(). ...
2
votes
1
answer
76
views
Shapley contribution when coalition is 0
I am exploring Shapley for channel attribution based on [here][1]
Consider C1, C2, C3, C4 as 4 channels in question.
Some of the coalition does not have value, such as
...