A simple weighted sum of how many times feature i was split on at each depth in the forest.

variable_importance(forest, decay.exponent = 2, max.depth = 4)

Arguments

forest

The trained forest.

decay.exponent

A tuning parameter that controls the importance of split depth.

max.depth

Maximum depth of splits to consider.

Value

A list specifying an 'importance value' for each feature.

Examples

# \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 'importance' of each feature. variable_importance(q.forest)
#> [,1] #> [1,] 0.37984462 #> [2,] 0.07170245 #> [3,] 0.07033936 #> [4,] 0.06269977 #> [5,] 0.07422793 #> [6,] 0.08082653 #> [7,] 0.06425380 #> [8,] 0.06942898 #> [9,] 0.06839812 #> [10,] 0.05827843
# }