Jim Johnson Jim Johnson - 1 year ago 160
R Question

GBM multinomial distribution, how to use predict() to get predicted class?

I am using the multinomial distribution from the gbm package in R. When I use the

function, I get a series of values:

5.086328 -4.738346 -8.492738 -5.980720 -4.351102 -4.738044 -3.220387 -4.732654

but I want to get the probability of each class occurring. How do I recover the probabilities? Thank You.

Answer Source

Take a look at ?predict.gbm, you'll see that there is a "type" parameter to the function. Try out predict(<gbm object>, <new data>, type="response").

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download