
Calculate partial dependence of a response on select predictor variables.
dependence(
object,
data = NULL,
select = NULL,
interaction = FALSE,
n = 10,
intervals = c("uniform", "quantile"),
distr = character(),
method = character(),
stats = MachineShop::settings("stats.PartialDependence"),
na.rm = TRUE
)
PartialDependence
class object that inherits from
data.frame
.
model fit result.
data frame containing all predictor variables. If not specified, the training data will be used by default.
expression indicating predictor variables for which to compute
partial dependence (see subset
for syntax)
[default: all].
logical indicating whether to calculate dependence on the interacted predictors.
number of predictor values at which to perform calculations.
character string specifying whether the n
values are
spaced uniformly ("uniform"
) or according to variable quantiles
("quantile"
).
arguments passed to predict
.
function, function name, or vector of these with which to compute response variable summary statistics over non-selected predictor variables.
logical indicating whether to exclude missing predicted response values from the calculation of summary statistics.
# \donttest{
## Requires prior installation of suggested package gbm to run
gbm_fit <- fit(Species ~ ., data = iris, model = GBMModel)
(pd <- dependence(gbm_fit, select = c(Petal.Length, Petal.Width)))
plot(pd)
# }
Run the code above in your browser using DataLab