This function calculates the partial dependence of a model on a single variable.
For that predictions are made for all observations in the dataset while varying
the value of the variable of interest. The overall partial effect is the average
of all predictions. Friedman2001GreedyMachineSDModels
The average prediction for each value of the variable of interest.
x_seq
The sequence of values for the variable of interest.
preds
The predictions for each value of the variable of interest for each observation.
j
The name of the variable of interest.
xj
The values of the variable of interest in the dataset.
Arguments
object
A model object that has a predict method that takes newdata as argument
and returns predictions.
j
The variable for which the partial dependence should be calculated.
Either the column index of the variable in the dataset or the name of the variable.
X
The dataset on which the partial dependence should be calculated.
Should contain the same variables as the dataset used to train the model.
If NULL, tries to extract the dataset from the model object.
subSample
Number of samples to draw from the original data for the empirical
partial dependence. If NULL, all the observations are used.
mc.cores
Number of cores to use for parallel computation.
Parallel computing is only supported for unix.