predict.gbm: Predict method for GBM Model Fits
Description
Predicted values based on a generalized boosted model objectUsage
predict.gbm(object, newdata, n.trees, ...)
Arguments
object
Object of class inheriting from "gbm" (gbm.object
) newdata
Data frame in which to predict
n.trees
Number of trees used in the prediction
...
further arguments passed to or from other methods
Value
- Returns a vector of predictions on the scale of f(x). For example, for the
Bernoulli loss the returned value is on the log odds scale, poisson loss on the
log scale, and cox proportional hazard is on the log hazard scale.
Details
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.