Skip to contents

This function predicts values based on generalized boosted model objects.

Usage

forecast_by_gbm(
  object,
  newx,
  type = c("response", "class", "link"),
  newoffset,
  pthr = 0.5,
  ...
)

Arguments

object

an object of class gbm.object

newx

the new values at which prediction are to be made

type

the type of prediction. Three options are available

"response"

predicted values are on the same scale as the outcome, e.g. for Bernoulli the returned values are probabilities, for Poisson the expected counts

"class"

the class corresponding to the max probability

"link"

predictions are on the scale of f(x), e.g. for Bernoulli the returned value is on the log odds scale

newoffset

the new offset, if provided it is added to the predicted value

pthr

probability threshold, used when type = "class" and response is binomial to assign label to observation

...

further arguments to predict.gbm

Value

A vector containing the predictions.

Author

Alessandro Barberis