Questions tagged [shap]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
43 views

Feature importance using random forest vs. SHAP

I recently came across SHAP while looking for feature-importance methods. To use SHAP, first a model needs to be created, and then based on the predictions made by the model, SHAP values are ...
lsr729's user avatar
  • 183
0 votes
1 answer
59 views

Determining SHAP values for combined features

Say I have a dataset with three features: X1, X2 and X1 + X2. How would I determine the SHAP values for just singular features? I'll denote I denote the SHAP value of say X1 as SHAP(X1). Would it be ...
user156361's user avatar
0 votes
0 answers
21 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 ...
Chrisanto's user avatar
0 votes
0 answers
22 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$ ...
Noomkwah's user avatar
  • 101
1 vote
1 answer
35 views

shapley graph plot via python

Does anybody know how can we plot this graph? Sth like attached.
Turan's user avatar
  • 113
0 votes
0 answers
79 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 ...
cwanderroycbooks's user avatar
0 votes
1 answer
170 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 ...
schmibbler's user avatar
0 votes
1 answer
160 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 ...
Amir Jalilifard's user avatar
1 vote
1 answer
198 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 ...
Amir Jalilifard's user avatar
1 vote
1 answer
146 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 ...
Pritam Sinha's user avatar
0 votes
1 answer
563 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 ...
Gabriel Monteiro's user avatar
2 votes
0 answers
318 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 ...
agun7's user avatar
  • 21
0 votes
2 answers
3k 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 ...
Muppi's user avatar
  • 1
2 votes
2 answers
514 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 ...
skan's user avatar
  • 185
1 vote
1 answer
778 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, <...
Gaurav Bansal's user avatar
2 votes
1 answer
262 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 ...
Tom's user avatar
  • 65
0 votes
1 answer
1k 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 ...
SteveS's user avatar
  • 133
4 votes
1 answer
443 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 ...
hideonbush's user avatar
0 votes
0 answers
35 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 ...
Evan's user avatar
  • 185
1 vote
0 answers
86 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 ...
Phillip Maire's user avatar
2 votes
0 answers
854 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 ...
The Great's user avatar
  • 2,565
2 votes
1 answer
4k 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 ...
The Great's user avatar
  • 2,565
1 vote
1 answer
575 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. ...
Giampaolo Levorato's user avatar
0 votes
0 answers
809 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 ...
Giampaolo Levorato's user avatar
1 vote
0 answers
229 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 ...
Giampaolo Levorato's user avatar
3 votes
0 answers
1k views

Differences between Feature Importance and SHAP variable importance graph

I have run an XGBClassifier using the following fields: ...
Giampaolo Levorato's user avatar
0 votes
1 answer
198 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]...
NAS_2339's user avatar
  • 233
1 vote
0 answers
302 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 ...
jda's user avatar
  • 111
1 vote
0 answers
224 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 ...
Rayne's user avatar
  • 131
0 votes
0 answers
93 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&...
Guy Barash's user avatar
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, ...
rebar's user avatar
  • 31
2 votes
0 answers
237 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/...
Tpeeters's user avatar
0 votes
1 answer
350 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 ...
spectre's user avatar
  • 2,020
3 votes
2 answers
6k 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?
xlra's user avatar
  • 31
0 votes
2 answers
357 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. ...
dean's user avatar
  • 103
1 vote
1 answer
314 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 ...
zzzbob's user avatar
  • 45
1 vote
0 answers
70 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 ...
aishik roy chaudhury's user avatar
1 vote
0 answers
287 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?...
Kamyar Yazdani's user avatar
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 ...
Mario's user avatar
  • 410
1 vote
0 answers
46 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 ...
Fatima's user avatar
  • 71
2 votes
0 answers
230 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 ...
Raghav Goyal's user avatar
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 ...
atudell's user avatar
2 votes
0 answers
755 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(). ...
Mario's user avatar
  • 410
2 votes
1 answer
85 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 ...
Kenny's user avatar
  • 121
5 votes
1 answer
392 views

Shapley values without intercept (or without `expected_value`)

I have a model and I want to derive its interpretability by using feature contributions. In the end, I want to have some contribution per feature such that the sum of contributions equals the ...
David Masip's user avatar
  • 6,051
1 vote
0 answers
52 views

Passing reduced/different feature data to LimeTabularExplainer compared to the original model

I am trying to use LimeTabularExplainer class and explain_instance function to find explainations of my LightGbm (lgb) model. However, the lgb model uses complex feature set which are not ...
the M's user avatar
  • 11
6 votes
1 answer
716 views

How to achieve SHAP values for a CatBoost model in R?

I'm asked to create a SHAP analysis in R but I cannot find it how to obtain it for a CatBoost model. I can get the SHAP values of an XGBoost model with ...
user100740's user avatar
3 votes
0 answers
664 views

Explain FastText model using SHAP values

I have trained fastText model and some fully connected network build on its embeddings. I figured out how to use Lime on it: complete example can be found in Natural Language Processing Is Fun Part 3: ...
Mikhail_Sam's user avatar
0 votes
0 answers
45 views

Ways to visualize the outcome of machine learning interpretability techniques (for image classification)

“Machine Learning Interpretability” or “Explainable Artificial Intelligence” has become quite popular in the machine learning community and in recent research. The goal is to make complex (deep ...
member_10's user avatar
2 votes
0 answers
430 views

Aggregate SHAP importances from different models

A couple of questions on the SHAP approach to the estimation of feature importance. I would like to use the random forest, logistic regression, SVM, and kNN to train four classification models on a ...
CaffeineMan's user avatar