predict.TDboost: Predict method for TDboost Model Fits

View source: R/TDboost.R

predict.TDboostR Documentation

Predict method for TDboost Model Fits

Description

Predicted values based on an TDboost Tweedie regression model object

Usage

## S3 method for class 'TDboost'
predict(object,
        newdata,
        n.trees,
        single.tree=FALSE,
		  type=c("response","link"),
        ...)

Arguments

object

Object of class inheriting from (TDboost.object)

newdata

Data frame of observations for which to make predictions

n.trees

Number of trees used in the prediction. n.trees may be a vector in which case predictions are returned for each iteration specified

single.tree

If single.tree=TRUE then predict.TDboost returns only the predictions from tree(s) n.trees

type

type of prediction required.

  • Type "response" gives predicted response mu(x) = E(Y|X=x) for the regression problems. It is the default.

  • Type "link" gives the linear predictors x*b = log(mu(x)) = log(E(Y|X=x)) for the regression problems.

...

further arguments passed to or from other methods

Details

predict.TDboost produces predicted values for each observation in newdata using the the first n.trees iterations of the boosting sequence. If n.trees is a vector than the result is a matrix with each column representing the predictions from TDboost models with n.trees[1] iterations, n.trees[2] iterations, and so on.

The predictions from TDboost do not include the offset term. The user may add the value of the offset to the predicted value if desired.

If object was fit using TDboost.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.

Value

Returns a vector of predictions. By default the predictions are on the scale of f(x).

Author(s)

Yi Yang yi.yang6@mcgill.ca, Wei Qian wxqsma@rit.edu and Hui Zou hzou@stat.umn.edu

See Also

TDboost, TDboost.object


emeryyi/tdboost documentation built on Aug. 16, 2022, 7:17 a.m.