partialDependence
Compute partial dependence
Syntax
Description
computes the partial dependence pd = partialDependence(RegressionMdl,Vars)pd between the predictor variables
listed in Vars and model predictions. In this syntax, the model
predictions are the responses predicted by using the regression model
RegressionMdl, which contains predictor data. If
RegressionMdl is a model object that does not contain predictor
data (for example, a compact model), you must also provide the input argument
Data.
computes the partial dependence pd = partialDependence(ClassificationMdl,Vars,Labels)pd between the predictor variables
listed in Vars and the scores for the classes specified in
Labels by using the classification model
ClassificationMdl, which contains predictor data. If
ClassificationMdl is a model object that does not contain predictor
data (for example, a compact model), you must also provide the input argument
Data.
uses additional options specified by one or more name-value arguments. For example, if you
specify pd = partialDependence(___,Name,Value)"UseParallel","true", the
partialDependence function uses parallel computing to perform the
partial dependence calculations.
Examples
Input Arguments
Name-Value Arguments
Output Arguments
More About
Algorithms
For both a regression model (RegressionMdl) and a classification
model (ClassificationMdl), partialDependence uses a
predict function to predict responses or scores.
partialDependence chooses the proper predict
function according to the model and runs predict with its default settings.
For details about each predict function, see the predict
functions in the following two tables. If the specified model is a tree-based model (not
including a boosted ensemble of trees), then partialDependence uses the
weighted traversal algorithm instead of the predict function. For details,
see Weighted Traversal Algorithm.
Regression Model Object
Classification Model Object
Alternative Functionality
plotPartialDependencecomputes and plots partial dependence values. The function can also create individual conditional expectation (ICE) plots.
References
[2] Hastie, Trevor, Robert Tibshirani, and Jerome Friedman. The Elements of Statistical Learning. New York, NY: Springer New York, 2009.






