NorskRegnesentral/shapr

GroupShapley in python

Billwuzl opened this issue · 5 comments

Hi!

Many thanks for this awesome project! I am currently working on a python project that requires me to calculate Shapley values of feature groups. Your project, Shapr, is really helpful to me. However, I noticed that the python wrapper does not include the calculation of Group Shapley

May I know when the version that includes Group Shapley in python will be released?

Hi, thank you for your interest.

I believe it is supposed to work through the group input argument. What kind of error message do you get? I am currently not near a computer.

Thank you for your timely reply.

https://github.com/NorskRegnesentral/shapr/blob/master/python/shaprpy/explain.py#L116

At line 116 of explain.py, it seems to me that no group list is used.

When my input includes group list, the same output is given as if group list is not included.

Looks like wrong arguments in in L117 and L119. Shouldn't this be

        group = maybe_null(group),
        n_batches = maybe_null(n_batches),

?

Yes, there is a bug here, and what you write above is correct. Unsure if further edits are needed, though. Unfortunately, I have not yet had time to fix it, but will try to prioritize it soon. Feel free to provide a PR.