Learn R Programming

grf (version 2.3.2)

split_frequencies: Calculate which features the forest split on at each depth.

Description

Calculate which features the forest split on at each depth.

Usage

split_frequencies(forest, max.depth = 4)

Value

A matrix of split depth by feature index, where each value is the number of times the feature was split on at that depth.

Arguments

forest

The trained forest.

max.depth

Maximum depth of splits to consider.

Examples

Run this code
# \donttest{
# Train a quantile forest.
n <- 250
p <- 10
X <- matrix(rnorm(n * p), n, p)
Y <- X[, 1] * rnorm(n)
q.forest <- quantile_forest(X, Y, quantiles = c(0.1, 0.5, 0.9))

# Calculate the split frequencies for this forest.
split_frequencies(q.forest)
# }

Run the code above in your browser using DataLab