plot.local_surrogate_explainer: Generic plot function for local surrogate explainers

Description Usage Arguments Examples

View source: R/plot_print.R

Description

Generic plot function for local surrogate explainers

Usage

1
2
## S3 method for class 'local_surrogate_explainer'
plot(x, ..., geom = "bar")

Arguments

x

object of class local_surrogate_explainer

...

other objects of class local_surrogate_explainer. If provided, models will be plotted in rows, response levels in columns.

geom

If "point", lines with points at the end will be plotted, if "bar", bars will be plotted and if "arrow", arrows.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Example based on apartments data from DALEX package.
library(DALEX)
library(randomForest)
library(localModel)
data('apartments')
mrf <- randomForest(m2.price ~., data = apartments, ntree = 50)
explainer <- explain(model = mrf,
                     data = apartments[, -1])
model_lok <- individual_surrogate_model(explainer, apartments[5, -1],
                                        size = 500, seed = 17)
model_lok
plot(model_lok)

localModel documentation built on Sept. 14, 2021, 5:12 p.m.