Search code examples
rgbm

Partial Dependency plots and Gradient boosting (GBM package)


Is it possible to plot a partial dependency plot to display the class probability and estimate the effects of a predictor for a GBM model? Something similar to partialPlot from randomForest package.

enter image description here

According to this article, a partial plot is doable with gbm.

Thanks in advance for your help.


Solution

  • I found the solution,

    In order to estimate the effects of a predictor, one should use this:

    plot(gbm.model, i.var = 1, lwd = 2, main = "")

    i.var is the number of the variable predictor, in the order shown in your formula. E.g y = x1+x2+x3

    Thanks to Mr. Campbell