-
Notifications
You must be signed in to change notification settings - Fork 18
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
Error in if (ncol(res) == 1) { : argument is of length zero #51
Comments
ps: If I use the package SHAPforxgboost to calculate the shap values, I also receive an error:
There are several other users who have the same error as well as can be seen at the bottem of this post: https://liuyanguu.github.io/post/2019/07/18/visualization-of-shap-for-xgboost/ And here: Maybe this could be an indication of the rootcause of the error. Thank you. |
@marboe123 Can you show what the output is from calling |
@bgreenwell thank you for your response! The output is : If I look into the lists I see BIAS, BIAS.1, BIAS.2 and similar for my variables: x, x.1, x.2 etc. Are these the shap values I can use if the shap values at itself are sufficient for me? |
Yes! I’ll fix the package to account for multi class models. But here you have a list with one component of Shapley values for each of your three class outcomes. In the binary case you really only need one. I’ll leave this issue open until I can get a fix, but those are exactly what you’re looking for! |
That is great. I have already been testing with |
Hello,
I receive the error above after I use this command:
shap_values <- fastshap::explain(model_n, X = trainval, exact = TRUE)
model_n is a multiclassification model fitted with xgboost.
trainval is my train-data
When I run this set-up for binary classification, the shap values are calculated correctly.
When I run this set-up for multiclass classification, the error above is generated.
Do you have any idea what can be the cause?
Thanks a lot!
The text was updated successfully, but these errors were encountered: