As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [shapley-value]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer
92 views

If feature importance is only computed based on training set, does it mean one should never compute shap values on test set?

If feature importance is only calculated from the training set according to here, does it mean one should never compute shap values on test set? What would it mean if I compute shap values from test ...
user1769197's user avatar
  • 1,052
1 vote
0 answers
37 views

How can I compute the SHAP values in a high dimensional dataset?

I have a classiification problem with a dataset where the number of variables is very large, and the number of observations is small. Approximately 200 observations and 10000 variables. I am using a ...
Alberto Perez Martinez's user avatar
1 vote
1 answer
65 views

SHAP values of Ensemble Model

I predict a continuous variable by taking the average of $N$ model predictions. The models are different in terms of their functional form, i.e. a tree model, a neural net, etc. Is the average SHAP ...
shenflow's user avatar
  • 989
3 votes
1 answer
58 views

importance score for correlated features xgboost

I am confused about the derivation of importance scores for an xgboost model. My understanding is that xgboost (and in fact, any gradient boosting model) examines all possible features in the data ...
dean's user avatar
  • 159
1 vote
1 answer
68 views

Combined Shapley Values for Probability Models

Using Python I have created two separate XGBoost probability models. From these two models, I compute a final value by multiplying the outputs (probabilities) together to give a probability of both ...
Gee Buttersnapz's user avatar
1 vote
0 answers
52 views

SHAP values vs logistic regression

I read many articles about SHAP values and I get the general theory behind it. However, there's something that I have a difficulty with. When we try to explain LR models, we explain it in terms of ...
gknowme's user avatar
  • 21
0 votes
0 answers
29 views

SHAP features contibution plot for aggregrated model metrics explanaition

I'd like to use SHAP in a specific manner to explain contribution of features for average score per date For example let's craft some toy dataset import pandas as ...
James Flash's user avatar
0 votes
0 answers
340 views

How do I interpret negative SHAP values for a marketing model?

I am building a marketing model to evaluate marketing channel effectiveness. My inputs are the marketing spend for each channel, and my target variable is sales. I have 3 years of weekly data in ...
jvukovic's user avatar
1 vote
0 answers
118 views

Bounds of Shapley values for variable importance

Imagine you have either a very good predictive model $f$ for a response $y$ or two highly predictive models $f_1$ and $f_2$. Is it possible to bound the "true" Shapley values of $y$ in ...
g g's user avatar
  • 2,297
2 votes
0 answers
359 views

xgboost feature importance vs shap values ranking interpretation

If we have two features, A and B. Feature A has a higher gain than feature B when analyzing feature importance in xgboost with gain. However, when we plot the shap ...
Chris's user avatar
  • 475
0 votes
0 answers
24 views

Comparing SHAP values across different trained version

I am having two random forest model trained for Week A and Week B of data for same set of features. With similar hyper parameters, let us say them as rf1 and rf2. I would like to bridge the difference ...
tart1234's user avatar
0 votes
0 answers
18 views

How to measure the week over week variation of input variables?

I am trying to determine the week over week change in revenue. I have certain product attribute that contribute to the change in revenue. Does something like this of a formulation will be correct? ...
tart1234's user avatar
3 votes
1 answer
311 views

Can someone explain the concept of Shapley value masking when working with tabular data and classification problems?

My understanding of a mask in arrays is to have boolean values matching the shape of a query array (n, m) where you would mask the query and perform an operation. For example, this operation to sum ...
O.rka's user avatar
  • 1,382
1 vote
0 answers
71 views

Are shapely values invariant under monotonic feature transformation?

I have been using shap values as a measure of feature importance for some time. But, I have never understood the justification behind comparing the shap values for features that are on different ...
figs_and_nuts's user avatar
0 votes
0 answers
45 views

Would it be ok to scale SHAP values and draw conclusions from them?

I’ve built a regression model to perform a certain task. For a given prediction task, I take the output from this model, multiply it by 0.77 and that is the final value that I use. If I apply shap to ...
Gabby Newell's user avatar
0 votes
0 answers
48 views

How to interpret the values returned by TreeShap for multilabel 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 ...
db_max's user avatar
  • 101
0 votes
0 answers
64 views

How to do Causal Inference for Observational Data [Supply Cain]?

Problem statement: Understand what factors impact the different operational times in a supply chain warehouse operation. I have observational data (past 1 year) which contains number of orders, ...
Shivam Bindal's user avatar
1 vote
1 answer
95 views

Calculating performance scores by subtracting the Shapley feature effects from predictions

One of my friends has done the following: He trained an XGBoost model let's call it Model 1 and then calculated the feature effects using Shapley for the different ...
DimKoim's user avatar
  • 121
0 votes
0 answers
252 views

Combining and plotting SHAP results across cross-validation splits

How does one combine SHAP results across cv splits, specifically using sklearn's train_test split? The closest solution I have found is here, which I have adjusted like so, using the publically ...
o.l.iva's user avatar
  • 21
1 vote
1 answer
91 views

Does there exist any causal explainability tool for NNs?

Say I have a neural network which has 1,000,000 parameters built using 100 features and I wish to understand the underlying data-generating process for how the model arrived at each prediction. Simply ...
Tim's user avatar
  • 11
0 votes
0 answers
288 views

How to interpret Shap summary plot on causal application with X,T,Y?

I am trying to make sense of how to interpret the following Shap plot given the context of a causal model. See article of relevance: https://towardsdatascience.com/causal-machine-learning-for-...
titutubs's user avatar
  • 193
1 vote
0 answers
65 views

Pooling SHAP values from multiple imputed data

I have multiple imputed data and will be conducting an identical lightGBM model with the same input features in each of the imputed datasets. My aim is to calculate SHAP values (SHapley Additive ...
Austin's user avatar
  • 11
2 votes
0 answers
794 views

SHAP value transformation to probabilities

For my research project, I use SHAP values for plotting multiple diagrams to investigate the prediction process for a XGBoost and CatBoost model. I wonder how ...
Daniel's user avatar
  • 145
1 vote
0 answers
246 views

Total contribution of feature using SHAP values in multi-output regression problem

I am interested in using SHAP values to perform wrapper-based feature selection. The model has 3 outputs, and I do have SHAP values for each output, using GradientExplainer, but even after a bit of ...
sean1295's user avatar
2 votes
0 answers
184 views

Understanding feature importance for collinear features with tree-based models

I'm trying to understand how collinearity affects feature importance for tree-based models. My understanding is that tree-based models naturally overcome multicollinearity for the purposes of ...
Marina W.'s user avatar
0 votes
0 answers
25 views

Integration part from Shapley value equation

Reading following page, I can't understand integration part https://christophm.github.io/interpretable-ml-book/shapley.html#the-shapley-value-in-detail I can't understand following two equations Eq0 : ...
YoungMin Park's user avatar
0 votes
0 answers
15 views

Question about Shapley value math from Christopher molnar book

I have a question on math notation from following page https://christophm.github.io/interpretable-ml-book/shapley.html#the-shapley-value-in-detail I suppose following data example There is equation1 $...
YoungMin Park's user avatar
0 votes
0 answers
122 views

Shap values summary plot

I am trying to use SHAP values for a high-dimensional dataset (107 features), and when I use the shap.summary_plot method, it seems like only only 20 features are ...
pandi20's user avatar
  • 61
1 vote
0 answers
52 views

Can I combine Shapley scores?

I'm working in a context where some of the feature engineering on a dataset is done in one step of the pipeline and then different models are run on this feature engineered dataset. The problem is ...
roundsquare's user avatar
1 vote
0 answers
232 views

Should we prefer mean of absolute or square Shapley values?

Usually (for linear models at least) Shapley values are defined as deviations to some mean. By default, it seems the bar plot of the popular python package shap diplays the mean of absolute Shapley ...
matovitch's user avatar
  • 111
2 votes
1 answer
249 views

Can SHAP be used for linear mixed models?

Can SHAP importance be used for linear mixed models? I've seen it used for a variety of different modeling methods and was curious if it was possible to use it for linear mixed models? I am using the ...
Detr4's user avatar
  • 103
1 vote
0 answers
73 views

Appropriateness of using SHAP values to evaluate a model

I am a deep learning researcher that would like to use SHAP values to assess the relative importance of input features on the model's final score. Colleagues of mine have taken issue with the method ...
jlapin's user avatar
  • 21
1 vote
1 answer
3k views

Why SHAP base/expected value is 0.5 for all my instances?

I am working on a binary classification using random forest model, neural networks in which am using SHAP to explain the model predictions. I followed the tutorial and wrote the below code to get the ...
The Great's user avatar
  • 2,472
3 votes
1 answer
779 views

What is the use of expected value in machine learning models?

I see that we have a concept called expected value being used in machine learning (ML) models. For example, SHAP has a concept called Expected value. It means when ...
The Great's user avatar
  • 2,472
1 vote
1 answer
917 views

SHAP values and feature-target correlations contradict each other - why?

I am using SHAP values in a model explainability analysis and I am seeing a pattern of results where the SHAP values are clearly pointing in a positive or negative direction for most features, i.e. ...
hp2500's user avatar
  • 31
1 vote
2 answers
569 views

How to calculate SHAP for a factor in a linear model?

Shapley additive explanation (SHAP) are used to explain the prediction of a model $Y = f(X_1,...,X_p) + \varepsilon$. If we observe $x_1,...,x_p$ and predict $y$, then for each $i$ the contribution of ...
Diaa Al mohamad's user avatar
2 votes
0 answers
948 views

SHAP for stacking classifier

We are using a stacking classifier to solve a classification problem. The data feed 5 base models, the predicted probabilities of the base models feed the supervisory classifier. We would like to use ...
donlelef's user avatar
4 votes
2 answers
101 views

When interpreting machine learning models, should preprocessing steps be considered as part of "model"?

Suppose I have some inputs on which I first apply some feature engineering and then apply a machine learning algorithm such as random forest to make predictions. Now, if I want to interpret/explain ...
sara iftikhar's user avatar
7 votes
0 answers
840 views

How shap values behave in terms of multicollinearity in Trees, Ensemble, GradientBoosting and GAM/Boosting

I set up an experiment with these 8 Regressor Methods: sklearn package DecisionTreeRegressor, RandomForestRegressor, ExtraTreesRegressor, GradientBoostingRegressor other packages CatBoostRegressor ,...
Patrick Bormann's user avatar
1 vote
0 answers
51 views

Why do Shapley values increase over time?

I calculated the Shapley values (using xgboot package, gbm regression model) of several big actors in the cocoa market and received results which I cannot explain: it seems that Shapley increases (the ...
Cateded Ur's user avatar
13 votes
1 answer
3k views

Are SHAP values potentially misleading when predictors are highly correlated?

Are SHAP (SHapley Additive exPlanations) values potentially misleading when predictors are highly correlated? How and why? If so, is there any guidance on when not to use SHAP? Are there any rules ...
Adrian's user avatar
  • 4,050
1 vote
2 answers
180 views

feature importance aggregation

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
  • 159
5 votes
1 answer
772 views

Is there any reason to use LIME now that shap is available?

The context: explaining a binary classifier XGBoost model. If we say that we are limited to the LIME and Shapley Additive Explanation aka "shap" package, is there any reason to use LIME? My ...
JPErwin's user avatar
  • 453
0 votes
0 answers
92 views

Aggregating SHAP values obtained from different models?

I have SHAP values for two models (sklearns's GradientBoostingClassifier and RandomForestClassifier). They are positively correlated. Rank correlation (r_s) between the SHAP values of the two models ...
user avatar
2 votes
0 answers
44 views

shap value of a shuffled feature [closed]

Imagine I have a model to predict a 100 target values y based on 10 features stored in a X table (100 by 10). Similarly to what ...
gdupret's user avatar
  • 21
1 vote
0 answers
76 views

How does Shapley obtain values in the probability space in tree classifiers?

By default, the Shapley values for a tree explainer (e.g. based on xgboost) are in the log odds space (where they are additive). However, there's a functionality in the package to obtain values in the ...
simon's user avatar
  • 121
1 vote
1 answer
78 views

Can adding more data, influence the SHAPley values?

I am having a classification dataset. Everytime I add more data to the dataset the SHAP values are getting changed and the top list of features are changed. Can anyone explain what is this behavior? ...
JSVJ's user avatar
  • 115
1 vote
0 answers
97 views

Calculate overall attribution with Shapley values

I'm using a shap KernelExplainer to interprete my model and I'd like to display an indication of why the explainer sorted the features in that order. For example, some kind of overall score that ...
heisenberg's user avatar
1 vote
1 answer
936 views

Shap values on scaled dataset

I am working on a binary classification problem for heart disease prediction. I have scaled the dataset using Standard Scaler and I am trying to understand the model generated using SHAP values ...
Aastha Jha's user avatar
7 votes
1 answer
6k views

Can I scale and then interpret shap values as percent contribution to the prediction?

Let's say I have prediction for an observation with 3 shap values: -2, 3 and 5 for feature A, B and C respectively. Then I scale the absolute value of the shap values so they sum to 1 (i.e A=0.2, B=0....
tom1919's user avatar
  • 73