Prediction from HAL fits
An object of class hal9001
, containing the results of
fitting the Highly Adaptive Lasso, as produced by fit_hal
.
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.
If the user supplied X_unpenalized
during
training, then user should also supply this matrix with the same number of
observations as new_data
.
A vector of offsets. Must be provided if provided at training.
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.
A numeric
vector of predictions from a hal9001
object.
Method for computing and extracting predictions from fits of the
Highly Adaptive Lasso estimator, returned as a single S3 objects of class
hal9001
.
This prediction method does not function similarly to the equivalent
method from glmnet. In particular, this procedure will not return a
subset of lambdas originally specified in calling fit_hal
nor result in re-fitting. Instead, it will return predictions for all of
the lambdas specified in the call to fit_hal
that constructs
object
, when fit_control
's cv_select
is set to
FALSE
. When fit_control
's cv_select
is set to
TRUE
, predictions will only be returned for the value of lambda
selected by cross-validation.