predict.gbm(object,newdata,n.trees,
type="link",
single.tree=FALSE,
...)gbm.object)single.tree=TRUE then predict.gbm returns
only the predictions from tree n.trees.If type="response" then gbm converts back to the same scale as the outcome. Currently the only effect this will have is returning probabilities for bernoulli and expected counts for poisson. For the other distributions "response" and "link" return the same.
predict.gbm runs each observation in newdata through the trees
described by object$trees[1:n.trees], the first n.trees in the boosting
sequence. The function returns sum of the predictions from each of the trees.If object was fit using gbm.fit there will be no
Terms component. Therefore, the user has greater responsibility to make
sure that newdata is of the same format (order and number of variables)
as the one originally used to fit the model.
gbm, gbm.object