plotVI {rfVarImpOOB}R Documentation

creates barplots for variable importances

Description

creates barplots for variable importances

Usage

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



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)






[Package rfVarImpOOB version 1.0.3 Index]