estimate_partial_dependence: Estimate partial dependence of model predictions to variables

Description Usage Arguments Details Value See Also

Description

This functions evaluates and represents the partial dependence of a model prediction to changes in individual variable values.

Usage

1
estimate_partial_dependence(modelPath, variables)

Arguments

modelPath

the path of the RData file where the model is saved

variables

character vector. The names of the variables for which the partial independence should be evaluated.

Details

The function estimates (using generatePartialDependenceData) how the model stored in modelPath is affected by changes in one of several variables values. The partial dependence of the model for a given variable is calculated by setting all the other variables to their mean values and by exploring the changes in model prediction by setting the values of the variable of interest over a range. If, during the construction of the DT unit using build_DT, several models were trained (i.e. nIter larger than 1), the partial dependence is calculated and represented for each of the individual model.

Once the partial dependence values calculated, a plot is produced representing the changes in model predictions over the range of the variable values. A loess smoothed curve is added to represent the tendencies. The distribution of the values of the variable of interest in the training data set is also represented.

Value

a list with two elements: data the estimated partial dependence values and plot a ggplot object representing the trends of the relationships between model predictions and the values of the variable of interest.

See Also

generatePartialDependenceData


CedricMondy/ecodiag documentation built on May 10, 2019, 3:14 a.m.