min_depth_interactions: Calculate mean conditional minimal depth

Description Usage Arguments Value Examples

Description

Calculate mean conditional minimal depth with respect to a vector of variables

Usage

1
2
3
4
5
6
min_depth_interactions(
  forest,
  vars = important_variables(measure_importance(forest)),
  mean_sample = "top_trees",
  uncond_mean_sample = mean_sample
)

Arguments

forest

A randomForest object

vars

A character vector with variables with respect to which conditional minimal depth will be calculated; by default it is extracted by the important_variables function but this may be time consuming

mean_sample

The sample of trees on which conditional mean minimal depth is calculated, possible values are "all_trees", "top_trees", "relevant_trees"

uncond_mean_sample

The sample of trees on which unconditional mean minimal depth is calculated, possible values are "all_trees", "top_trees", "relevant_trees"

Value

A data frame with each observation giving the means of conditional minimal depth and the size of sample for a given interaction

Examples

1
2
forest <- randomForest::randomForest(Species ~ ., data = iris, ntree = 100)
min_depth_interactions(forest, c("Petal.Width", "Petal.Length"))

randomForestExplainer documentation built on July 12, 2020, 1:06 a.m.