pdp2d: Explanation gap visualization

Description Usage Arguments Author(s) References Examples

View source: R/explainability.R

Description

Visualization of 2D PDP vs. unexplained residual predictions.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
pdp2d(
  model,
  x,
  vnames,
  type = "pdp",
  depth = 21,
  alpha = 2/3,
  right = 0.8,
  top = 0.95,
  digits = 1,
  ...
)

Arguments

model

A model with corresponding predict function that returns numeric values.

x

Data frame.

vnames

Character vector of the variable set for which the patial dependence function is to be computed.

type

Character, either "pdp", "gap" or "both" specifying the meaning of the colours of scatter: either the value of the PD function or the differences between PD and the model's predcitions. In case of "both" two plots are created.

depth

Integer specifiying the number colours in the heat map.

alpha

Numeric value for alpha blending of the points in the scatter plot.

right

Position where to place the legend relative to the range of the x axis.

top

Position where to place the legend relative to the range of the y axis.

digits

Nuber of digits for rounding in the legend.

...

Further arguments to be passed to the predict() method of the model.

Author(s)

gero.szepannek@web.de

References

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
library(pdp)
library(randomForest)
data(boston)
set.seed(42)
boston.rf <- randomForest(cmedv ~ ., data = boston)
pdp2d(boston.rf, boston, c("lstat", "rm"), type = "both")

## End(Not run)

g-rho/eXplaAInability documentation built on April 6, 2021, 1:42 a.m.