# predict.gbm

From gbm v0.6
0th

Percentile

##### Predict method for GBM Model Fits

Predicted values based on a generalized boosted model object

Keywords
models, regression
##### Usage
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
##### 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.

##### 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.

gbm, gbm.object