To calculate the coefficient of partial determination R2 for a given variable:
We calculate the R2 with and without that variable and substract them. This implies fitting a different model with and without that variable.
I don't know if for this calculation it's better to use adjusted R2s or unadjusted ones.

The procedure to calculate the SHAP value is more convoluted:
The average of the output variation for random inputs on the other variables is calculated, varying just one variable, two, three... and in different orders.
This process can be repeated from different staring inputs and take the grand average.

SHAP is a black-box method useful for any model but it's very slow. Sampling some of the data and interpolation may be used to accelerate its calculation.

But intuitively...
How are the interpretation of the partial R2 and the SHAP value different when applied to a linear regression model?

https://online.stat.psu.edu/stat462/node/138/ https://christophm.github.io/interpretable-ml-book/shapley.html#shapley https://www.aidancooper.co.uk/a-non-technical-guide-to-interpreting-shap-analyses/


2 Answers 2


Since no answers have been posted yet I will do my best....

SHAP values don't reflect the output's variation when a variable is removed from the model, as R2 does.

SHAP values are the contribution of a given value of an input variable to the difference between the actual prediction and the mean prediction, though this can be further averaged out for all the input values.

They are somewhat related but they are not exactly the same.

It would be great to find an equation relating both things.


I think one main difference is that SHAP value calculate the marginal contribution of the features across all the coalition, which includes the interaction between this features and other features.

The partial R square only represents the explained residuals for adding the feature(/predictor) to the model additively.

Reference: https://towardsdatascience.com/from-shapley-to-shap-understanding-the-math-e7155414213b


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.