forestToMatrix: Forest2Matrix

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Transform trees of a ranger-object to a matrix

Usage

1
forestToMatrix(rfObject)

Arguments

rfObject

ranger object

Value

a matrix object with Column 1: tree ID Column 2: node ID Column 3: child node ID 1 Column 4: child node ID 2

Examples

1
2
3
library(ranger)
rf.fit <- ranger(Species ~ ., data = iris, num.trees = 5, write.forest = TRUE)
forestMat <- forestToMatrix(rf.fit)

CaseBasedReasoning documentation built on June 12, 2018, 5:18 p.m.