Re: [R] Help on Random forest [Broadcast]

From: Liaw, Andy <andy_liaw_at_merck.com>
Date: Wed 11 Oct 2006 - 12:53:37 GMT


Do provide a reproducible example, as the Posting Guide suggests.

Try:

library(randomForest)
example(predict.randomForest)
iris.pred <- predict(iris.rf, iris[ind == 2,], nodes=TRUE) str(iris.pred)
attr(iris.pred, "nodes")

Andy  

From: Rupendra
>
> Hello all,
>
> I am trying to explore random forest in R. What I want to do
> is get the node number in which the case falls in the tree of
> random forest. For that I am calling the predict method as:
>
> learn.pred <- predict (learn.rf,
> newdata=learn.data.x,norm.votes= TRUE,predict.all = TRUE,
> nodes= TRUE,type="response")
>
> Studying the manual of random forest, I suppose that
> learn,pred$nodes should contain the node numbers, but there
> is no attributes called nodes in learn.pred object.
>
>
>
> I am not much experienced with R. Please help me to resolve
> this issue.
>
>
>
> Thanks in advance,
>
> Rupendra
>
>
> PRIVACY NOTICE
>
> This email and any attachments may be confidential and/or\...{{dropped}}



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed Oct 11 23:25:48 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 11 Oct 2006 - 14:30:09 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.