measure_importance {randomForestExplainer} | R Documentation |
Importance of variables in a random forest
Description
Get a data frame with various measures of importance of variables in a random forest
Usage
measure_importance(forest, mean_sample = "top_trees", measures = NULL)
Arguments
forest |
A random forest produced by the function randomForest with option localImp = TRUE |
mean_sample |
The sample of trees on which mean minimal depth is calculated, possible values are "all_trees", "top_trees", "relevant_trees" |
measures |
A vector of names of importance measures to be calculated - if equal to NULL then all are calculated;
if "p_value" is to be calculated then "no_of_nodes" will be too. Suitable measures for |
Value
A data frame with rows corresponding to variables and columns to various measures of importance of variables
Examples
forest <- randomForest::randomForest(Species ~ ., data = iris, localImp = TRUE, ntree = 300)
measure_importance(forest)