Skip to content
Prev 30062 / 398513 Next

randomForests predict problem

Well, thank you for your answer, but this is not doing the right thing, 
that is predicting the Class value for the test set Soybean[test,]. It 
gives instead prediction for data used for forest computation (ignoring all 
data with NA's) ; 'data' argument is simply ignored as the right name for 
this argument is 'newdata', which still gives the same error when named.

 > length(sb.rf.pred)
[1] 445
 > dim(Soybean[test,])
[1] 150  36
 > dim(Soybean[-test,])
[1] 533  36
 > sb.rf.pred <- predict(sb.rf, newdata=st)
Error in matrix(t1$countts, nr = nclass, nc = ntest) :
         No data to replace in matrix(...)
At 13:13 02/04/03, you wrote: