R/min_depth_interactions.R
min_depth_interactions.Rd
Calculate mean conditional minimal depth with respect to a vector of variables
min_depth_interactions(
forest,
vars = important_variables(measure_importance(forest)),
mean_sample = "top_trees",
uncond_mean_sample = mean_sample
)
A randomForest object
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
The sample of trees on which conditional mean minimal depth is calculated, possible values are "all_trees", "top_trees", "relevant_trees"
The sample of trees on which unconditional mean minimal depth is calculated, possible values are "all_trees", "top_trees", "relevant_trees"
A data frame with each observation giving the means of conditional minimal depth and the size of sample for a given interaction
forest <- randomForest::randomForest(Species ~ ., data = iris, ntree = 100)
min_depth_interactions(forest, c("Petal.Width", "Petal.Length"))