Random Forests depth and path

Viewed 55

I'm currently using the R-package randomForest. Furthermore I trained a random forest with

data(iris)
mydata <- iris[, 1:4]
iris.rf <- randomForest(Sepal.Length ~ ., data = mydata, ntree = 500)

I got two questions now:

  • How can I extract the maximal depth of each of the 500 trees?
  • Given a new vector x, how can I get the corresponding final node (path) it falls in?
0 Answers
Related