Skip to contents

Plots and returns a Rforestry object with a single tree explaining the PDP surface.

Usage

localSurrogate(
  object,
  features.2d = NULL,
  interact = FALSE,
  params.forestry = list()
)

Arguments

object

Interpreter object to make plots + surrogate for.

features.2d

A two-column dataframe of pairs of features to make local surrogates for. Each row represents a pair of features, with the names of features as the entries.

interact

An indicator specifying if the surrogate model should also be given the interaction terms to create the surrogate models with. Default is FALSE.

params.forestry

Optional list of parameters to pass to the surrogate model. Defaults to the standard Rforestry parameters with ntree = 1 and maxDepth = 2.

Value

A list of two distinct lists: one list contains the local surrogate models, and the other containing the 2-D PDP plots for the specified features.