create_rank_table: Create Table of Variable Importance Rankings for VADIS...

View source: R/create_rank_table.R

create_rank_tableR Documentation

Create Table of Variable Importance Rankings for VADIS analysis

Description

Create Table of Variable Importance Rankings for VADIS analysis

Usage

create_rank_table(mod_list, conditional = TRUE)

Arguments

mod_list

A list of random forest model objects. Currently supports objects of class RandomForest-class, ranger, and randomForest

conditional

logical. Should conditional (default) or unconditional permutation variable importance be computed. Only applies to RandomForest-class models from the party package.

path

Path in which to save the output (as .csv file). If NULL, defaults to the current working directory. Set path = FALSE if you do not wish to save to file.

Details

The function loops through a list of random forest objects, extracts the variable importance estimates, and compiles them in a single dataframe. For RandomForest-class models, function uses the permimp function (Debeer & Strobl 2020) with the default threshold (0.95) and AUC= TRUE (Janitza et al. 2013). For forests fit with ranger or randomForest, the importance argument must be specified. #'

Value

A dataframe

Author(s)

Jason Grafmiller

References

Debeer, Dries & Carolin Strobl. 2020. Conditional permutation importance revisited. *BMC Bioinformatics* 21(1). 307. https://doi.org/10.1186/s12859-020-03622-2.

Janitza, Silke, Carolin Strobl & Anne-Laure Boulesteix. 2013. An AUC-based permutation variable importance measure for random forests. *BMC Bioinformatics* 14(1). 119. https://doi.org/10.1186/1471-2105-14-119.

Examples

## Not run: 
fmla <- Type ~ PossrAnimacyBin + PossrWordC + PossmWordC + FinalSibilant +
  TypeTokenRatio + ProtoSemanticRelation + PossrExpType

rf_fnc <- function(x) ranger::ranger(fmla, data = x, importance = "permutation")

rf_list <- lapply(data_list, rf_func)

create_rank_table(rf_list, path = FALSE)

## End(Not run)

jasongraf1/VADIS documentation built on July 19, 2023, 10:26 p.m.