ranger_forests_to_matrix: Forest2Matrix

View source: R/utils.R

ranger_forests_to_matrixR Documentation

Forest2Matrix

Description

Transform trees of a ranger-object to a matrix

Usage

ranger_forests_to_matrix(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


library(ranger)
rf.fit <- ranger(Species ~ ., data = iris, num.trees = 5, write.forest = TRUE)
forest_matrix <- ranger_forests_to_matrix(rf.fit)



sipemu/case-based-reasoning documentation built on May 5, 2023, 12:59 a.m.