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

randomForest.unify error #23

Closed
wilkinbp opened this issue Jan 25, 2023 · 3 comments · Fixed by #30
Closed

randomForest.unify error #23

wilkinbp opened this issue Jan 25, 2023 · 3 comments · Fixed by #30

Comments

@wilkinbp
Copy link

I am trying to unify my random forest model using the available function but am consistently getting the same error, "Error in Prediction/n : non-numeric argument to binary operator"

The random forest model is a binary classifier. I have ensured that there are no categorical variables in the predictor data (i.e., the data is completely numeric) and that all NA values have been removed. I have also reconstructed the random forest so that the labels for the binary classification are "0" and "1" respectively, to see if that made a difference. What is perplexing to me is that, within the randomForest package, the "predict" function executes just fine and gives a correct output.

Any idea where the error is originating and how to fix it? Thanks!

@MargjeSchuur
Copy link

I have the same issue when explaining a randomForest classification model. As far as I can see it is due to the fact that the target has to be a factor value and it ends up as such in the attribute list. All my other feautures are numerc. Fooling the message leads to an error later on. So currently it only works for regression, I guess?!
I would love to use treeshap in R to explain classification models and cannot wait to see extended functionality on this.
Margje

@gibsok
Copy link

gibsok commented Feb 7, 2023

Also having this same Issue.

@krzyzinskim krzyzinskim mentioned this issue Sep 27, 2023
@krzyzinskim krzyzinskim linked a pull request Sep 27, 2023 that will close this issue
@krzyzinskim
Copy link
Collaborator

@wilkinbp, @MargjeSchuur, @gibsok
randomForest.unify() function should now (#30) work for randomForest binary classifier that have a target that is a factor with levels 0 and 1.

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

Successfully merging a pull request may close this issue.

4 participants