first two columns are terminal node IDs; If an ID pair do not appear in a tree -1 is inserted
distanceTerminalNodes(rfObject)
ranger object
ranger
a matrix object with pairwise terminal node edge length
matrix
# NOT RUN { require(ranger) rf.fit <- ranger(Species ~ ., data = iris, num.trees = 5, write.forest = TRUE) d <- distanceTerminalNodes(rf.fit) # }
Run the code above in your browser using DataCamp Workspace