variable_importance: Variable importance using random forests

Description Usage Arguments Value References See Also Examples

Description

Computes local or aggregate variable importance for a set of predictors from a fitted random forest object from the party, randomForest, randomForestSRC, or ranger package

Usage

1
variable_importance(fit, vars, interaction, nperm, data, ...)

Arguments

fit

object of class 'RandomForest', 'randomForest', 'rfsrc', or 'ranger'

vars

character, variables to find the importance of

interaction

logcal, compute the joint and additive importance for observations (type = "local") or variables type = "aggregate"

nperm

positive integer giving the number of times to permute the indicated variables (default 10)

data

optional (unless using randomForest) data.frame with which to calculate importance

...

additional arguments to be passed to permutationImportance.

Value

a named list of vars with the return from permutationImportance for each.

References

Breiman, Leo. "Random forests." Machine learning 45.1 (2001): 5-32.

See Also

plot_imp for plotting the results of variable_importance.

Examples

1
2
3
4
library(randomForest)
data(iris)
fit = randomForest(Species ~ ., iris)
variable_importance(fit, nperm = 2, data = iris)

edarf documentation built on May 2, 2019, 2:39 a.m.