Learn R Programming

radiant.model (version 1.6.12)

pdp_partial: Compute partial dependence for supported model types

Description

Brute-force implementation of partial dependence that covers the model types used within radiant.model (xgb.Booster, lm, glm, ranger, rpart, nnet). This is an internal replacement for pdp::partial().

Usage

pdp_partial(
  object,
  pred.var,
  pred.grid,
  train,
  prob = FALSE,
  quantiles = FALSE,
  probs = 1:9/10,
  plot = FALSE,
  plot.engine = "ggplot2",
  rug = FALSE,
  ...
)

Value

A data frame with class c("partial","data.frame") when

plot = FALSE, or a ggplot object when plot = TRUE.

Arguments

object

A fitted model object.

pred.var

Character vector of predictor variable names.

pred.grid

Optional data frame with the grid of values to use.

train

Training data (data frame or matrix).

prob

Logical; if TRUE return probabilities for classification.

quantiles

Logical; use sample quantiles for the grid instead of equally-spaced values.

probs

Numeric vector of probabilities when quantiles = TRUE.

plot

Logical; if TRUE return a ggplot2 object.

plot.engine

Ignored (kept for API compatibility).

rug

Logical; add rug marks when plot = TRUE.

...

Ignored (kept for API compatibility).