Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additivity constraint #1

Open
nredell opened this issue Apr 29, 2020 · 1 comment
Open

Add additivity constraint #1

nredell opened this issue Apr 29, 2020 · 1 comment

Comments

@nredell
Copy link
Owner

nredell commented Apr 29, 2020

At present, for each instance, the sum of the Shapley values will not exactly equal the model prediction. Assuming that the reference population is the right population, in the limit of Monte Carlo samples, the sum of the feature-level Shapley values will equal that instance's prediction. However, due to the stochastic nature of the sampling, this may not be the case in practice.

I'll add an optional argument to shap() that will adjust the Shapley values to support the additivity constraint at the instance level.

@nredell
Copy link
Owner Author

nredell commented May 28, 2020

Added a reconcile_instance = false argument to shap(). The default is set to false and still needs to be unit tested, but it's looking correct. The adjustments are likely going to be very small for any applied problem (i.e., correcting the Shapley sum to get a percent or two closer to the model predictions).

The instance-level adjustment is not exact. There is still some tolerance between the sum of the adjusted Shapley values + model intercept and the straight up model predictions. I need to explore this more with some applied problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant