xpy: Explainability and matchplot for PDP

Description Usage Arguments Value Author(s) References Examples

View source: R/explainability.R

Description

Computes explainability and matchplots for a partial dependence function.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
xpy(
  model,
  x,
  vnames,
  viz = TRUE,
  parallel = TRUE,
  sample = 1,
  pfunction = NULL,
  ...
)

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.

viz

Logical specifying whether a matchplot should be created.

parallel

Logical specifying whether computation should be parallel.

sample

fraction-size for sampling of x.

pfunction

User generated predict function.

...

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

Value

Numeric value with the explainability of the partial dependence function for the variables specified in vnames.

Author(s)

gero.szepannek@web.de

References

Examples

1
2
3
4
5
6
library(pdp)
library(randomForest)
data(boston)
set.seed(42)
boston.rf <- randomForest(cmedv ~ ., data = boston)
xpy(boston.rf, boston, c("lstat", "rm"))

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