- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I recently fit a a random forest model, and created Shapley values for the scored records (using the HyperSHAP method). In the output, it displays a Shapley value for the intercept. Is there an intuitive way to interpret what the intercept value means in this context? Explaining how the other variables contribute to the prediction is straight forward, but I am stumped when it comes to the intercept (especially if it is a negative value, like my example below).
This is the code I ran to create the Shapley values table:
proc cas;
loadactionset "explainModel";
explainModel.shapleyExplainer / table = "Input_table"
query = "score_sample_1"
modelTable = {caslib="casuser",
name = "Stored_Model_v1"}
modelTableType = "ASTORE"
predictedTarget = "P_target1"
inputs = {&inputlst}
outputTables = {names= {"ShapleyValues" = "HyperSHAP_Stats"}}
depth = 1
;
run;
quit;
Here is the Shapley values output from the code above:
Variable | ShapleyValue |
Intercept | -0.08110334 |
Var_1 | -0.011890304 |
Var_2 | -0.006514712 |
Var_3 | -0.002237833 |
Var_4 | -0.002140751 |
Var_5 | -0.002024026 |
Var_6 | -0.001596565 |
Var_7 | -0.000849501 |
Var_8 | -0.00028321 |
Var_9 | 0.00062736 |
Var_10 | 0.006623832 |
Var_11 | 0.014028848 |
Var_12 | 0.016726198 |
Var_13 | 0.026388227 |
Var_14 | 0.028782221 |
Var_15 | 0.036830496 |
Var_16 | 0.045865352 |
Var_17 | 0.066095825 |
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The intercept value of Shapley values can be seen as a "default prediction" from the model when the model doesn't know any feature/variable values. I'd like to think of it this way: For each variable, its Shapley value is this particular variable's contribution to this prediction. However, when we don't give any information about any variable, a model can still predict something about the outcome. For example, if we were asked to predict a person's resting heart rate without giving any information about the person, we can still come up with an educated guess (somewhere between 60-80) because that's what people's resting heart rate tends to be. This "model's guess without particular information about the observation" is the Shapley intercept value. If we know more about the person (gender, age, health conditions) then we can adjust our guess based on that information, and those adjustments are the Shapley values for those features/variables.
Typically the intercept should be equal or close to the mean of the predictions of the reference dataset (the data in the table parameter), though there are cases when this is not true because HyperSHAP (and KernelSHAP, or any methods estimating Shapley values) is an estimation of the true Shapley value and there could be errors in the estimation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Please review this SAS publication, https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2020/4502-2020.pdf where Shapley value estimation and interpretation are presented with examples.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the link. While the paper contains useful information, it doesn't have any references to the SHAP intercept values, and how to interpret them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The intercept value of Shapley values can be seen as a "default prediction" from the model when the model doesn't know any feature/variable values. I'd like to think of it this way: For each variable, its Shapley value is this particular variable's contribution to this prediction. However, when we don't give any information about any variable, a model can still predict something about the outcome. For example, if we were asked to predict a person's resting heart rate without giving any information about the person, we can still come up with an educated guess (somewhere between 60-80) because that's what people's resting heart rate tends to be. This "model's guess without particular information about the observation" is the Shapley intercept value. If we know more about the person (gender, age, health conditions) then we can adjust our guess based on that information, and those adjustments are the Shapley values for those features/variables.
Typically the intercept should be equal or close to the mean of the predictions of the reference dataset (the data in the table parameter), though there are cases when this is not true because HyperSHAP (and KernelSHAP, or any methods estimating Shapley values) is an estimation of the true Shapley value and there could be errors in the estimation.