# Get mode of decision trees from Random Forest

I am trying to find out how to determine / display the mode of the decision trees (used by Random Forest to make further predictions / assignments). I am using library(randomForest) in R:

r <- randomForest(Species ~., data=train.set, importance=TRUE, do.trace=100, ntree=100)


I can extract a given tree using t <- getTree(r, k=2) where k is the tree number. However, in my understanding, Random Forest is using the mode of these trees to classify new items.

How can I access this, and perhaps display a final decision tree?

• >"However, in my understanding, Random Forest is using the mode of these trees to classify new items. How can I access this, and perhaps display a final decision tree?" Do you mean you want predict? – Sycorax Aug 26 '16 at 20:32
• I am looking for a generally digestible way for reporting the results to an audience typically used to regression coefficients and linear weights, etc. I know I can display Mean Decrease Gini, but I was wondering if there was a way to illustrate the RF output using a decision tree illustration – ollama Aug 26 '16 at 23:21
• I'd just use a single tree as an example, and explain that there are many such trees, each different. – Sycorax Aug 26 '16 at 23:24
• it is an ensemble so you get a weighted average. If you want the individual results then you can use get tree to get individuals out and look at their individual predictions. – EngrStudent Sep 5 '16 at 16:29