tree_info | R Documentation |
Extracts tree information from a ocf.forest
object.
tree_info(object, tree = 1)
object |
|
tree |
Number of the tree of interest. |
Nodes and variables IDs are 0-indexed, i.e., node 0 is the root node.
All values smaller than or equal to splitval
go to the left and all values larger go to the right.
A data.frame
with the following columns:
nodeID |
Node IDs. |
leftChild |
IDs of the left child node. |
rightChild |
IDs of the right child node. |
splitvarID |
IDs of the splitting variable. |
splitvarName |
Name of the splitting variable. |
splitval |
Splitting value. |
terminal |
Logical, TRUE for terminal nodes. |
prediction |
One column with the predicted conditional class probabilities. |
Riccardo Di Francesco
Di Francesco, R. (2025). Ordered Correlation Forest. Econometric Reviews, 1–17. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/07474938.2024.2429596")}.
ocf
## Generate synthetic data.
set.seed(1986)
data <- generate_ordered_data(1000)
sample <- data$sample
Y <- sample$Y
X <- sample[, -1]
## Fit ocf.
forests <- ocf(Y, X)
## Extract information from tenth tree of first forest.
info <- tree_info(forests$forests.info$forest.1, tree = 10)
head(info)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.