@adityashrm21 wrote:
Hello,
I a facing a problem while impementing a randomForest model in R.
I am getting an error saying->Error in randomForest.default(m, y, ...) : Can't have empty classes in y.
randomforest was running fine before I added this to my code
dat=rbind(train,test)
dat$amount=0
dat$amount[dat$amount_tsh==0]=1train=dat[1:59400,]
test=dat[59401:nrow(dat),]Why is this error coming after using this code? What has changed in my train dataset after creating a new variable like this? How to get rid of it?
Thanks!
Posts: 5
Participants: 4