predict.hal9001 {hal9001} | R Documentation |
Prediction from HAL fits
Description
Prediction from HAL fits
Usage
## S3 method for class 'hal9001'
predict(
object,
new_data,
new_X_unpenalized = NULL,
offset = NULL,
type = c("response", "link"),
...
)
Arguments
object |
An object of class |
new_data |
A |
new_X_unpenalized |
If the user supplied |
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 |
Details
Method for computing and extracting predictions from fits of the
Highly Adaptive Lasso estimator, returned as a single S3 objects of class
hal9001
.
Value
A numeric
vector of predictions from a hal9001
object.
Note
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.