vimp: Variable Importance

Description Usage Arguments Value Examples

View source: R/vimp.R

Description

With the help of this function the permutation variable importance for random forests can be created for any measure that is available in the mlr package.

Usage

1
vimp(mod, measures = list(auc), task, data)

Arguments

mod

An object of class randomForest, as that created by the function randomForest with option keep.inbag = TRUE

measures

List of performance measure(s) of mlr to evaluate. Default is auc only.

task

Learning task created by the function makeClassifTask or makeRegrTask of mlr.

Value

Returns a dataframe with a column for each desired measure.

Examples

1
2
3
4
5
6
7
library(mlr)
library(randomForest)

# Classification
data = getTaskData(iris.task)
mod = randomForest(Species ~., data = data, ntree = 100, keep.inbag = TRUE)
results = vimp(mod, measures = list(mmce, multiclass.au1u, multiclass.brier), task = iris.task, data = data)

PhilippPro/vimp documentation built on June 24, 2017, 4:35 a.m.