Questions tagged [shap]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
5 views

Exact Shap calculations for logistic regression?

Given the relatively simple form of the model of standard logistic regression. I was wondering if there is an exact calculation of shap values for logistic regressions. To be clear I am looking for a ...
user avatar
  • 2,107
0 votes
0 answers
13 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 ...
user avatar
  • 165
0 votes
0 answers
10 views

SHAP values for Binary Classification

I'm trying to understand the inner workings of how SHAP values are calculated for Binary Classification. The formula for calculating each SHAP value is: $$ \phi_i = \sum_{S \subseteq F \setminus {i}} \...
user avatar
  • 1
0 votes
0 answers
12 views

SHAP KernelExplainer AttributeError numpy.ndarray

I've developed a text classifier of the form of python function that can input a np.array of strings (each string is one observation). ...
user avatar
  • 101
0 votes
0 answers
10 views

Does shap value use the target variable in its calculation?

I saw this answer mentioning that shap uses the target variable but I can get shap values without the target variable using the shap values, for example ...
user avatar
1 vote
0 answers
8 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 ...
user avatar
2 votes
0 answers
37 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 ...
user avatar
  • 2,129
1 vote
1 answer
44 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 ...
user avatar
  • 2,129
1 vote
0 answers
26 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. ...
user avatar
0 votes
0 answers
47 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 ...
user avatar
0 votes
0 answers
14 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 ...
user avatar
1 vote
0 answers
35 views

Differences between Feature Importance and SHAP variable importance graph

I have run an XGBClassifier using the following fields: ...
user avatar
0 votes
0 answers
63 views

Why does SHAP's TreeExplainer with "interventional" method not match exact SHAP?

I am trying to understand the concepts/definitions behind the SHAP method of explaining model predictions. In particular I've read the original SHAP paper and the TreeExplainer paper. The original ...
user avatar
  • 1
0 votes
1 answer
31 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]...
user avatar
0 votes
0 answers
11 views

How are two linear models with features f1 and (C-f1) similar or different?

I am training a linear model. I'm planning to update this model every month. I have two perfectly correlated features such that f1+f2=C, where C is a constant. Since I cannot include both, I will be ...
user avatar
0 votes
0 answers
110 views

SHAP Kernel explainer for ensemble model

I am currently working on a project involving an unsupervised outlier detection ensemble model. However I am getting stuck by an error passed by the shap.KernelExplainer: "The passed model is not ...
user avatar
1 vote
0 answers
97 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 ...
user avatar
  • 111
0 votes
0 answers
11 views

Decision Trees and SHAP Values

I've recently been using some (optimal) decision trees methods in R, such as 'evtree' and 'iai.' Both of these provide really nice interpretable plots. And out of the 12 covariates I have in my model, ...
user avatar
  • 193
0 votes
0 answers
146 views

What is the difference between shap kernel-explainer and deep-explainer

I want to use shap to explain my image classification model. I read that it is better to use shap.DeepExplainer (than ...
user avatar
0 votes
0 answers
51 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 ...
user avatar
  • 111
0 votes
0 answers
36 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&...
user avatar
0 votes
0 answers
351 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, ...
user avatar
  • 21
1 vote
0 answers
72 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/...
user avatar
0 votes
0 answers
71 views

Interpret messy SHAP summary plot for a Random Forest

I have the following plot and it shows SHAP values in a way I haven't seen anywhere. I have a small dataset (400 observations). I used SHAP for my other models and those have the more traditional ...
user avatar
  • 111
0 votes
1 answer
62 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 ...
user avatar
  • 1,241
0 votes
0 answers
328 views

LSTM Shapley Deep Explainer TimeseriesGenerator Keras

I have this data in the form: X_train shape: (2724, 10) , y_train shape: (2724,) X_test shape: (682, 10) , y_test shape: (682,) which I feed into Keras' ...
user avatar
1 vote
2 answers
840 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?
user avatar
  • 11
0 votes
2 answers
104 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. ...
user avatar
  • 1
1 vote
1 answer
68 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 ...
user avatar
  • 45
1 vote
0 answers
29 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 ...
user avatar
1 vote
0 answers
117 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?...
user avatar
1 vote
1 answer
864 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 ...
user avatar
  • 369
1 vote
0 answers
24 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 ...
user avatar
  • 61
2 votes
0 answers
93 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 ...
user avatar
0 votes
0 answers
637 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 ...
user avatar
2 votes
0 answers
341 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(). ...
user avatar
  • 369
0 votes
1 answer
32 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 ...
user avatar
  • 101
5 votes
1 answer
172 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 ...
user avatar
  • 5,594
1 vote
0 answers
37 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 ...
user avatar
  • 11
5 votes
1 answer
375 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 ...
user avatar
2 votes
0 answers
387 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: ...
user avatar
0 votes
0 answers
38 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 ...
user avatar
1 vote
0 answers
161 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 ...
user avatar
4 votes
1 answer
4k views

How is the "base value" of SHAP values calculated?

I'm trying to understand how the base value is calculated. So I used an example from SHAP's github notebook, Census income classification with LightGBM. Right after I trained the lightgbm model, I ...
user avatar
2 votes
1 answer
579 views

Getting the positive impacting features using SHAP

I'm attempting to use SHAP to automatically extract feature names that have a positive impact on my regression models. On inspection of the code I see that the bar plot, for example, determines these ...
user avatar
1 vote
0 answers
37 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 ...
user avatar
  • 153
2 votes
1 answer
63 views

treeExplainer algorithm intuition

I'm reading the paper about the treeExplainer; the pseudo-code of Algorithm 1 is a bit cryptical as most of the variables are not even defined (same with sampling and all details involved). Is there a ...
user avatar
  • 45
1 vote
0 answers
49 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-...
user avatar
  • 133
1 vote
0 answers
255 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 ...
user avatar
2 votes
1 answer
803 views

How to calculate joint feature contribution for XGBoost Classifier in python?

I referred to this beautiful document to research about joint feature contibutions. But this works only for RandomForest algorithms because of treeinterpreter (does ...
user avatar