predict.gamtree: Get predictions from fitted GAM tree

View source: R/gamtree.R

predict.gamtreeR Documentation

Get predictions from fitted GAM tree

Description

Takes a fitted GAM tree (of class "gamtree") and returns predictions given a new set of values for the model covariates, or for the original covariate values used for fitting the GAM tree.

Usage

## S3 method for class 'gamtree'
predict(object, newdata = NULL, type = "link", ...)

Arguments

object

an object of class gamtree.

newdata

a data.frame containing the values of the model covariates for which predictions should be returned. The default (NULL) returns predictions for the original training data.

type

character vector of length 1, specifying the type of prediction to be returned. "response" (the default) returns values on the scale of the response variable. Alternatively, "link" (only available if method = "mob")returns values on the scale of the linear predictor; "node" returns an integer vector of node identifiers.

...

further arguments to be passed to predict.party.

Value

Returns a vector of predicted values.


marjoleinF/gamtree documentation built on July 3, 2024, 9:18 a.m.