[R] Random Forest prediction questions

Dror droryosef at hotmail.com
Mon Mar 1 14:21:15 CET 2010



Hi,
I need help with the randomForest prediction. i run the folowing code:
 
> iris.rf <- randomForest(Species ~ ., data=iris,
> importance=TRUE,keep.forest=TRUE, proximity=TRUE)
> pr<-predict(iris.rf,iris,predict.all=T)
> iris.rf$votes[53,]
    setosa versicolor  virginica 
 0.0000000  0.8074866  0.1925134 
> table(pr$individual[53,])/500

versicolor  virginica 
     0.928      0.072 
> 

why the voting is not the same for the same data? what do i do wrong?

another 2 questions:
1. i tries to debug another problem in which the individual vector was
smaller the tree number in the forest.
   i noticed that in this row of code:

   treepred <- matrix(object$classes[t1$treepred], nrow = length(keep), 
                dimnames = list(rn[keep], NULL))
the t1$treepred has values of 0 (i have 2 classes) and they droped from the
results
what does this 0 mean?

2. how can i drop a tree from the forest?

Thanks,
Dror
-- 
View this message in context: http://n4.nabble.com/Random-Forest-prediction-questions-tp1573530p1573530.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list