topepo / C5.0

An R package for fitting Quinlan's C5.0 classification model
https://topepo.github.io/C5.0/
50 stars 20 forks source link

After migrating R from 3.2.3 to 3.4.3 predict function throwing an error #11

Closed rmodepalli closed 6 years ago

rmodepalli commented 6 years ago

Earlier we are running our model on R version 3.2.3 which use C50 package(version 0.1.0.24) and working as expected. Now we migrated to R 3.4.3 with C50 (version 0.1.1) . With this upgrade we are getting following error.

Error: *** line 2 of undefined.cases': bad value of(0' for attribute `contrib_bucket'

We are getting above error for below function call.

clean_data$segment <- predict(segmentationModel, clean_data, type='class')

Is there any known bug with latest version? Thanks in advance for looking at this issue.

Please find below the steps to reproduce and required dataframe, model is attached. Reproduce.zip

Steps:

library(C50) cleandata <- readRDS(file="cleandata.Rda") load('segmentationModel.rdata') predict(segmentationModel, cleandata, type='class')

SessionInfo of Error Run:

sessionInfo() R version 3.4.3 (2017-11-30) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] C50_0.1.1

loaded via a namespace (and not attached): [1] Rcpp_0.12.14 lattice_0.20-35 mvtnorm_1.0-6 grid_3.4.3 plyr_1.8.4 magrittr_1.5 stringi_1.1.6 reshape2_1.4.3 rpart_4.1-11 Matrix_1.2-12
[11] partykit_1.2-0 splines_3.4.3 Formula_1.2-2 tools_3.4.3 stringr_1.2.0 Cubist_0.2.1 survival_2.41-3 compiler_3.4.3 libcoin_1.0-1 inum_1.0-0

SessionInfo of Successful Execution:

R version 3.2.3 (2015-12-10) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows Server x64 (build 14393)

locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] C50_0.1.0-24

loaded via a namespace (and not attached): [1] partykit_1.1-1 survival_2.38-3 splines_3.2.3 grid_3.2.3 Formula_1.2-2

And also I am not able to install C50 package on Ubuntu. Is C50 will support on Ubuntu?

topepo commented 6 years ago

The bug was in Cubist and should work now.

And also I am not able to install C50 package on Ubuntu. Is C50 will support on Ubuntu?

Can you elaborate?

rmodepalli commented 6 years ago

Thanks topepo for the fix. Do I need reinstall the package to get the fix? Regarding your question I am trying to install C50 on Ubuntu OS. I am not able to install on Ubuntu 16.0.

topepo commented 6 years ago

You should reinstall C50 and Cubist from GitHub. If you can't let me know and I can get the windows binaries built (if that's what you need).

I am not able to install on Ubuntu 16.0.

More details would help. Can you send the log of those installations?

rmodepalli commented 6 years ago

Thanks topepo. Now after downloading the C50 and Cubist from GitHub its working. I tried Ubuntu installation on new machine and its working. When can this fix will be available in CRAN?

topepo commented 6 years ago

I have a few more things to fix in C50 I would estimate it will be there within the month.