-
Notifications
You must be signed in to change notification settings - Fork 20
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 when plotting a C5.0 tree with factors which have spaces in levels #10
Comments
There is a similar issue with the same error, but a different root cause, which can be traced to the |
This should be fixed in the github version (0.1.1.9000) if you would like to test. |
I've also changed mf$drop.unused.levels <- FALSE for testing |
Hi, the plotting is good, except it reverses the order of my levels in the plot.
stepping through the code, it seems that in |
That appears to be how library(partykit)
mod <- ctree(Y~Sepal.Length,data=iris)
plot(mod) |
Hello, please see the below code which reproduces a bug in handling the levels of factors with spaces in the name when plotting C5.0 trees. This is in R version 3.4.1 (2017-06-30) x86_64-w64-mingw32 on Windows 7:
The error itself is due to NA values being passed in the index vector. The root cause is probably that the factor levels are being split on spaces, but I'm unable to trace exactly where. On line 212 of as.party.C5.0.R, the for loop which generates the index value throws NA's because the factor levels stored in a1s do not match the factor levels in xlev.
The text was updated successfully, but these errors were encountered: