varimp_stratified_rf: Heuristic on variable importance

Description Usage Arguments Details Value Examples

Description

Heuristic on variable importance, taken as averages from the variable importances calculated for each tree.

Usage

1
varimp_stratified_rf(model, metric = "usage", agg_type = "simple")

Arguments

model

A stratified_rf model.

metric

How to calculate the variable importance from each tree. Either "usage" or "splits".

agg_type

How to aggregate the variable importances obtained from each tree. Either "simple" for a simple average, or "weighted" for an average weighted by each tree's accuracy.

Details

Methods are taken directly from the C5.0 trees. Currently doesn't support permutation tests.

Value

A named data frame with the importance score of each variable, sorted from largest to smallest.

Examples

1
2
3
4
5
data(iris)
groups <- list(c("Sepal.Length","Sepal.Width"),c("Petal.Length","Petal.Width"))
mtry <- c(1,1)
m <- stratified_rf(iris,"Species",groups,mtry,ntrees=2,multicore=FALSE)
varimp_stratified_rf(m)

david-cortes/StratifiedRF documentation built on May 24, 2019, 7:25 p.m.