Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

varImpRanger

varImpRanger


Description

Computes the variable importance for ranger models and for arbitrary measures from the 'measures' package.

Usage

varImpRanger(object, data, target, nperm = 1, measure = "multiclass.Brier")

Arguments

object

An object as returned by cforest. ranger with option keep.inbag = TRUE.

data

Original data that was used for training the random forest.

target

Target variable as used in the trained model.

nperm

The number of permutations performed.

measure

The name of the measure of the 'measures' package that should be used for the variable importance calculation.

Value

Vector with computed permutation importance for each variable.

Examples

## Not run: 
library(ranger)
iris.rg = ranger(Species ~ ., data = iris, keep.inbag = TRUE, probability = TRUE)
vimp.ranger = varImpRanger(object = iris.rg, data = iris, target = "Species")
vimp.ranger

## End(Not run)

varImp

RF Variable Importance for Arbitrary Measures

v0.4
GPL-3
Authors
Philipp Probst [aut, cre], Silke Janitza [ctb]
Initial release
2020-05-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.