ggvip {randomForestVIP}R Documentation

Variable Importance GGPlot

Description

A ggplot of variable importance as measured by a Random Forest.

Usage

ggvip(x, scale = FALSE, sqrt = TRUE, type = "both", num_var)

Arguments

x

An object of class randomForest.

scale

For permutation based measures such as MSE or Accuracy, should the measures be divided by their "standard errors"? Default is False.

sqrt

Boolean value indicating whether importance metrics should be adjusted via a square root transformation. Default is True.

type

either 1 or 2, specifying the type of importance measure (1=mean decrease in accuracy or node impurity or mean decrease in gini). Default is "both".

num_var

Optional argument for reducing the number of variables to the top 'num_var'. Must be an integer between 1 and the total number of predictor variables in the model.

Value

A ggplot dotchart showing the importance of the variables that were plotted.

Examples

rf <- randomForest::randomForest(factor(Species) ~ .,
  importance = TRUE,
  data = iris
)
ggvip(rf, scale = FALSE, sqrt = TRUE, type = "both")

[Package randomForestVIP version 0.1.3 Index]