9
$\begingroup$

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.

$\endgroup$
12
$\begingroup$

Yes, it's really easy. Check out ?plot.gbm. The usage goes like this:

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

and looks like enter image description here

i.var controls the index of the variable to plot. You can also do two (or more) way plots using

 plot(gbm.model, i.var = c(1,2), lwd = 2, col = "blue", main = "")
| cite | improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ thank you, i really appreciate your efforts and time here and in your blog. $\endgroup$ – Panos Kal. Nov 14 '13 at 3:12

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.