py-why / dowhy

DoWhy is a Python library for causal inference that supports explicit modeling and testing of causal assumptions. DoWhy is based on a unified language for causal inference, combining causal graphical models and potential outcomes frameworks.
https://www.pywhy.org/dowhy
MIT License
7.01k stars 922 forks source link

Understanding the Shapley Value Implemented by the dowhy.gcm.shapley Module #957

Closed yanmluk closed 1 year ago

yanmluk commented 1 year ago

Hi, I was wondering for the dowhy.gcm.shapley module, what kind of shapley value is implemented? Is it causal shapley, marginal shapley, asymmetric shapley or other kind of shapley value? I speculate the module here applies the knowledge of causal structure since it's included in the gcm package. Thank you!

bloebp commented 1 year ago

The Shapley module itself is only a 'toolbox' that implements different methods to approximate Shapley values following the 'classical definition' (https://en.wikipedia.org/wiki/Shapley_value) for a given value/set/characteristic function. This is in general without any causal or graph context. The causal context comes typically from the definition of the set function. However, in that sense, it symmetrizes over all player permutations and does not reduce the set of possible permutations by, for instance, incorporating the graph structure.

yanmluk commented 1 year ago

Thank you! This is very helpful!