plotVI: creates barplots for variable importances

Description Usage Arguments Author(s) Examples

Description

creates barplots for variable importances

Usage

1
plotVI(VIbench, order_by = "Gini_OOB", decreasing = TRUE)

Arguments

VIbench

matrix with importance scores as returned by GiniImportanceForest

order_by

how to order

decreasing

which direction to sort

Author(s)

Markus Loecher <Markus.Loecher@gmail.com>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
data("titanic_train", package = "rfVarImpOOB",  envir = environment())


set.seed(123)


ranRows=sample(nrow(titanic_train), 300)


data=titanic_train[ranRows,]





RF = randomForest::randomForest(formula = Survived ~ Sex + Pclass + PassengerId,


                                       data=data,


                                       ntree=5,importance=TRUE,


                                       mtry=3,keep.inbag=TRUE, 


                                       nodesize = 20)


data$Survived = as.numeric(data$Survived)-1


VI_Titanic = GiniImportanceForest(RF, data,ylab="Survived")


plotVI(VI_Titanic,decreasing = TRUE)

markusloecher/rfVarImpOOB documentation built on July 5, 2020, 6:50 p.m.