plotVI2: creates barplots for variable importances

plotVI2R Documentation

creates barplots for variable importances

Description

creates barplots for variable importances including permutation scores

Usage

plotVI2(VIbench, decreasing = TRUE, with_MDA = TRUE, ordered_by = "inbag", 


    score = "Gini Importance", horizontal = TRUE, fill = "order", 


    labelSize = 10, nrow = 3)

Arguments

VIbench

matrix with importance scores as returned by GiniImportanceForest

decreasing

which direction to sort

with_MDA

also visualize mean decrease in accuracy (permutation importance)

ordered_by

how to order

score

type of importance score: Gini, MIA,..

horizontal

horizontal barplot instead of vertical ?

fill

fill style for barplots; use e.g. shQuote("blue") to pass color strings

labelSize

size of axis labels

nrow

number of rows of ploztz arrangement

Author(s)

Markus Loecher <Markus.Loecher@gmail.com>

Examples



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")


plotVI2(VI_Titanic,decreasing = TRUE)






rfVarImpOOB documentation built on July 1, 2022, 5:05 p.m.