Learn R Programming

StratifiedRF (version 0.2.2)

varimp_stratified_rf: Heuristic on variable importance

Description

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

Usage

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.

Value

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

Details

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

Examples

Run this code
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)

Run the code above in your browser using DataLab