Skip to main content

Questions tagged [shap]

The tag has no usage guidance.

38 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3 votes
0 answers
453 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
  • 31
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
3 votes
0 answers
703 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
2 votes
0 answers
948 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,575
2 votes
0 answers
256 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
2 votes
0 answers
238 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
2 votes
0 answers
792 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
  • 400
2 votes
0 answers
469 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
1 vote
0 answers
21 views

Interpreting the SHAP values presented in layered violin plot in SHAP-library for Scikit binary RandomForestClassifier

I am using the SHAP-library for computing feature Shapley values for a binary RandomForestClassifier which has naturally two outputs, 0 or 1. The forest itself consists from 100 decision tree ...
jjepsuomi's user avatar
  • 111
1 vote
0 answers
178 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
1 vote
1 answer
182 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
1 vote
0 answers
100 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
1 vote
0 answers
247 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
1 vote
0 answers
306 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
266 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
1 vote
0 answers
74 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
310 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
1 vote
0 answers
53 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
1 vote
0 answers
62 views

Can we use Shap to interpret output changes?

Can we calculate the difference between Shapley values to interpret changes in the output? More precisely, if we get Shapley values for two different inputs, can we compare them to understand how much ...
giogix's user avatar
  • 163
1 vote
0 answers
146 views

Difference between shap values and feature contributions

I always found both concepts a bit confusing since they are quite similar. Would someone provide clear example where to apply each? Shap values ref: https://towardsdatascience.com/explain-your-model-...
room13's user avatar
  • 133
1 vote
0 answers
439 views

Tree Path Dependent expected value

I stuck on this topic for couple days and seems I need your help to understand what is expected value in TreeExplainer when feature_perturbation = tree_path_dependent, precisely what is expected value ...
jacekblaz's user avatar
0 votes
0 answers
19 views

How to get Shap feature importance values for a random forest classifier at local level

I have a random forest classifier (binary) model that I'm using to run prediction on unseen test data. For each observation in the test data, I want to get the feature importance (which feature was ...
Tamanna Mostafa's user avatar
0 votes
0 answers
23 views

Questions about the process of feature selection through feature importance

'Shap feature importance' was obtained through xgboost, and variables with the lowest feature importance were removed one by one from 50 variables until only 1 variable remained. As a result of ...
JAE's user avatar
  • 13
0 votes
0 answers
19 views

Is it necessary to average the shap values ​that have been processed through cross validation?

Is it necessary to average the shap values ​​that have been processed through cross validation? I saw a post in Towards Data Science that calculated the shap value through 10 CV and then averaged it. ...
JAE's user avatar
  • 13
0 votes
0 answers
9 views

İnternal and hold out test for shap

There is an internal test set and a hold out test set. I explain the model with Shap library. Should I use the internal test set or the external test set? What should I do if there is a difference?
Nemo's user avatar
  • 1
0 votes
0 answers
47 views

What does the shap interaction value of a feature with itself mean?

SHAP allows us to compute interaction effects by considering pairwise feature attributions. This leads to a matrix of attribution values representing the impact of all pairs of features on a given ...
figs_and_nuts's user avatar
0 votes
0 answers
25 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 Sinatra's user avatar
0 votes
0 answers
27 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
0 votes
0 answers
96 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
2k 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
0 votes
0 answers
38 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
0 votes
0 answers
942 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
0 votes
0 answers
99 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
372 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,115
0 votes
2 answers
416 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
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
0 votes
0 answers
49 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
0 votes
0 answers
2k views

SHAP Kernel explainer for my pipeline model

I am trying to use SHAP kernel explainer to understand my XGBOOST model. My data is the lending club data and I am trying to predict the Grade of each customer. The data contains different types of ...
Omar Baz's user avatar