Quantcast
Channel: Data Science, Analytics and Big Data discussions - Topics tagged data_science
Viewing all articles
Browse latest Browse all 787

Error while implementing randomForest in R

$
0
0

@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]=1

train=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

Read full topic


Viewing all articles
Browse latest Browse all 787

Trending Articles