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

How to calculate weights for individual observations. #27

Open
jakobgerstenlauer opened this issue Jul 19, 2018 · 0 comments
Open

How to calculate weights for individual observations. #27

jakobgerstenlauer opened this issue Jul 19, 2018 · 0 comments

Comments

@jakobgerstenlauer
Copy link

I just observed that in the example code given on the medium.com blog, you calculated individual weights by simply calling rowSums(pred.breakdown) on the data set containing the feature contributions.
I think this is not correct because adding negative and positive feature contributions may cancel out effects.

Shouldn't it be s.th like:

weights = apply(pred.breakdown,1,function(x) sum(abs(x)))

I was referring to this blog:
https://medium.com/applied-data-science/new-r-package-the-xgboost-explainer-51dd7d1aa211

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