4
$\begingroup$

I'm working on a classification problem with continous and categorical predictors with Random Forests (RF). I'm particularly interested on RF as we avoid the specification of the functional form.

However when it comes to the partial dependence for categorical variables, I'm not sure how to interpret it. For instance, the partial dependence (with the command partialPlot in the R package randomForest) for a binary predictor would give two values, one for each category. My question is: how exactly do you interpret those values? The documentation of partialPlot is quite cryptic in this respect.

My confusion arises, I guess, because I'm used with usual logistic regression where with a dummy coding system you in general obtain the log-odds of the variable of interest against the baseline category. But with RF things are different... Any help is appreciable!

$\endgroup$
3
$\begingroup$

In general partial plots are the average of a series of hypothetical predictions.

For continuous variables, partialPlot selects a series of n.pt values along the variable of interest. It creates a test data set identical to the training data, and sequentially sets the variable of interest for all observations to a selected value. It then takes the average value of the predicted response for each test set and plots the results against the select value. For a binary categorical predictor, this process would result in only two values.

It is helpful to use partial plots in combination with variable dependence and interpret them together. The variable dependence figure is generated by plotting the forest predicted value against the variable of interest for each observation.

$\endgroup$
  • $\begingroup$ So in the case of a binary predictor, could you interpret the difference between the partialPlot values as the logit of one category against the other (assuming RF gives calibrated probabilities)? $\endgroup$ – utobi Mar 5 '15 at 10:08
  • 1
    $\begingroup$ Yes that is correct. See also Partial Dependence Plot interpretation. $\endgroup$ – Stephen Milborrow Nov 30 '16 at 22:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.