Predict method for GBM Model Fits
Predicted values based on a generalized boosted model object
predict.gbm(object, newdata, n.trees, ...)
- Object of class inheriting from "gbm" (
- Data frame in which to predict
- Number of trees used in the prediction
- further arguments passed to or from other methods
predict.gbm runs each observation in
newdata through the trees
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.
- 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.