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

SHAP Feature Importance #25

Open
Steviey opened this issue Feb 28, 2020 · 1 comment
Open

SHAP Feature Importance #25

Steviey opened this issue Feb 28, 2020 · 1 comment

Comments

@Steviey
Copy link

Steviey commented Feb 28, 2020

Hi there,

is there any elaborated way to obtain SHAP Feature Importance using shapper?

Reading this https://christophm.github.io/interpretable-ml-book/shap.html#shap-feature-importance

...I would guess, doing a loop over "shapper::individual_variable_effect" and mean() the results of attributions per vname could do the trick.

Am I wrong?

Is there any plan to integrate the original functions, like summary_plot to obtain SHAP feature importance?

By the way, when I try to feed the function individual_variable_effect with multiple new observations new_observation = testX[1:5, ] I get errors.

Error in $<-.data.frame(tmp, "_attribution_", value = c(0, -0.365675633989662, : replacement has 140 rows, data has 70

@stereolith
Copy link

Hello,
I needed just this functionality for a university project and implemented it here: #26 .
Additionally, to cope with larger data sets, I implemented the kmeans function of the SHAP Python lib to help summarize data instances.

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

2 participants