Plotting Prediction model of Multinomial GBM using R

Hello,
I am trying to plot the following prediction model of GBM -

gbm_model3 <- gbm(formula = trainformula, data = trainingdata3,distribution = “multinomial”, n.trees = 50,interaction.depth = 5, shrinkage = 0.1)

pred_gbm3 <- predict(gbm_model3, testingdata3, n.trees = 50,type = “response”)

Is there a way in which we can fit a curve for the above prediction ?

Hi @Sajal_Roy_92

What do you want to plot the curves for? There are only single values of parameters.

You can use caret to get the plot by passing multiple values of hyperparameters. The code will be the following:

library('caret')

gbm_model3 <- train(trainingdata3[,predictors] , trainingdata3[,outcome] ,method = "gbm"tuneLength = 5)
pred_gbm3 <- predict(gbm_model3, testingdata3[,predictors] )
plot(gbm_model3)

You can look more about caret, its tuning parameters passing process and CV strategies here:

2 Likes