1

I got the above error message by doing the following

cc2016cohort_amv$spl=sample.split(cc2016cohort_amv$nwb,SplitRatio = 0.7)
table(cc2016cohort_amv$spl)

train=subset(cc2016cohort_amv, cc2016cohort_amv$spl==TRUE)
test=subset(cc2016cohort_amv, cc2016cohort_amv$spl==FALSE)
trainX=train[,1:25]
trainy=train[,26]
testX=test[,1:25]
testy=test[,26]
model=C50::C5.0(trainX, trainy)

I received error as below: Error in C5.0.default(trainX, trainy) : C5.0 models require a factor outcome

Thus, I added

trainy=as.factor(trainy)

I received error as below:

Error in UseMethod("QuinlanAttributes") : no applicable method   
   for'QuinlanAttributes' applied to an object of class "c('POSIXct', 
   'POSIXt')"

Tried using the following packages POSIXct,POSIXt,PCICt,anytime, but it doesn't work.

Etalo
  • 11
  • 2
  • You should provide a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) so we can see the classes of all the variables involved. Sounds like you may have dates in your data set? Most models don't handle dates well. – MrFlick Mar 29 '17 at 04:23

0 Answers0