explain_forest: Explain a random forest

Description Usage Arguments Value Examples

View source: R/explain_forest.R

Description

Explains a random forest in a html document using plots created by randomForestExplainer

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
explain_forest(
  forest,
  path = NULL,
  interactions = FALSE,
  data = NULL,
  vars = NULL,
  no_of_pred_plots = 3,
  pred_grid = 100,
  measures = NULL
)

Arguments

forest

A randomForest object created with the option localImp = TRUE

path

Path to write output html to

interactions

Logical value: should variable interactions be considered (this may be time-consuming)

data

The data frame on which forest was trained - necessary if interactions = TRUE

vars

A character vector with variables with respect to which interactions will be considered if NULL then they will be selected using the important_variables() function

no_of_pred_plots

The number of most frequent interactions of numeric variables to plot predictions for

pred_grid

The number of points on the grid of plot_predict_interaction (decrease in case memory problems)

measures

A character vector specifying the importance measures to be used for plotting ggpairs

Value

A html document. If path is not specified, this document will be "Your_forest_explained.html" in your working directory

Examples

1
2
3
4
5
## Not run: 
forest <- randomForest::randomForest(Species ~ ., data = iris, localImp = TRUE)
explain_forest(forest, interactions = TRUE)

## End(Not run)

randomForestExplainer documentation built on July 12, 2020, 1:06 a.m.