shap icon indicating copy to clipboard operation
shap copied to clipboard

shap values scale differ for model type

Open skamkar opened this issue 8 years ago • 3 comments

Hi! I've got an observation and curious if the developers had any thoughts.

For tree-based binary classifcation problems, I've noticed that when computing Shapley values for XGB, the values represent the log-odds space, i.e., \sigmoid(\sum_i \phi_i) = f(x), but when computing Shapley for RF, the values represent the probability space, i.e., \sum_i \phi_i = f(x). Other than attempting a non-linear (and I believe non-unique) transformations from one space to another, how else can we create consistent explanations, e.g., XGB and RF both return Shapley values in the probability space?

Thank you.

skamkar avatar Jun 22 '18 21:06 skamkar

Quick followup - searched through the backlog of closed issues, specifically #29. The implementation and discussion of how to scale the values from log-odds into probability space are outlined therein. Thank you for that.

Is there current functionality that can transform the probability space into the log-odds space (for RF models)?

Thank you.

skamkar avatar Jun 22 '18 21:06 skamkar

There is not currently a function to approximate the mapping of SHAP values through a logistic (or logit) function. It is on a list to work on something better than just a linear rescaling.

The reason the RF is in probability space and XGB is in log-odds is because the RF keeps probabilities in its leaves and XGB keeps log-odds.

slundberg avatar Jun 23 '18 00:06 slundberg

Great. Thanks for the prompt reply.

skamkar avatar Jun 23 '18 06:06 skamkar