@AYUSHGS wrote:
Hi All,
I am trying to subset B from a bigger data A on some condition and trying to predict the bucket(Y) in which the sales of B lie using randomForest technique.
Following is the code I have used:-
df<-data.frame("")
sample.ind<-sample(2,nrow(mydata), replace = T,
prob = c(0.70,0.30))
crosssell_dev<- mydata[sample.ind==1,]
crosssell_val<- mydata[sample.ind==2,]
df<- subset(crosssell_dev, crosssell_dev$Account==“10185”)
mydata.rf<- randomForest(formula=df$Bucket~.,data = df,ntree=100,mtry=5,importance=T)but this is giving an error which is:“Error in randomForest.default(m, y, …) : Can’t have empty classes in y”.
Can Any please suggest what is wrong here.
Posts: 1
Participants: 1