Building a C5.0 tree in R

I am trying to build a tree of C5.0 objects in R, but it gives the following error, and I cannot figure out how to fix it.

plot(model) Error in partysplit(varid = as.integer(i), index = index, info = k, prob = NULL) : minimum of 'index' is not equal to 1 In addition: Warning message: In min(index, na.rm = TRUE) : no non-missing arguments to min; returning Inf 
+7
r
source share
2 answers

try it

 library(rattle) fancyRpartPlot(model) 
0
source share

It seems that the factors in your data frame contain spaces. I ran into the same problem, then I removed the spaces from them, and now it works. for example, if a variable has the bad and good factors, change them to bad and good.

"The error itself is due to the fact that the NA values ​​are transmitted in the index vector. The main reason is probably because the levels of the factors are divided into spaces." Here you can find https://github.com/topepo/C5.0/issues/10

0
source share

All Articles