Learn R Programming

ranger (version 0.4.0)

getTerminalNodeIDs: Get terminal node IDs of observations.

Description

Get terminal node IDs of observations.

Usage

getTerminalNodeIDs(rf, dat)

Arguments

rf
ranger object.
dat
New dataset. Terminal node IDs for this dataset are obtained.

Value

  • Matrix with terminal nodeIDs for all observations in dataset and trees.

Examples

Run this code
library(ranger)
rf <- ranger(Species ~ ., data = iris, write.forest = TRUE)
getTerminalNodeIDs(rf, iris)

Run the code above in your browser using DataLab