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

Description Usage Arguments Value Examples

View source: R/analysis_tools.R

Description

Calculate which features the forest split on at each depth.

Usage

1
split_frequencies(forest, max.depth = 4)

Arguments

forest

The trained forest.

max.depth

Maximum depth of splits to consider.

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.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
# Train a quantile forest.
n <- 50
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)

## End(Not run)

drf documentation built on March 29, 2021, 5:07 p.m.

Related to split_frequencies in drf...