Learn R Programming

hal9001 (version 0.4.6)

predict.hal9001: Prediction from HAL fits

Description

Prediction from HAL fits

Usage

# S3 method for hal9001
predict(
  object,
  new_data,
  new_X_unpenalized = NULL,
  offset = NULL,
  type = c("response", "link"),
  ...
)

Value

A numeric vector of predictions from a hal9001 object.

Arguments

object

An object of class hal9001, containing the results of fitting the Highly Adaptive Lasso, as produced by fit_hal.

new_data

A matrix or data.frame containing new data (i.e., observations not used for fitting the hal9001 object that's passed in via the object argument) for which the hal9001 object will compute predicted values.

new_X_unpenalized

If the user supplied X_unpenalized during training, then user should also supply this matrix with the same number of observations as new_data.

offset

A vector of offsets. Must be provided if provided at training.

type

Either "response" for predictions of the response, or "link" for un-transformed predictions (on the scale of the link function).

...

Additional arguments passed to predict as necessary.

Details

Method for computing and extracting predictions from fits of the Highly Adaptive Lasso estimator, returned as a single S3 objects of class hal9001.