Generate predictions from the model fitted by glmnet_with_cv. This function accepts new data and returns predictions, optionally debiased if a debiasing linear model was fit.
predict_cv(object, newdata, debias =FALSE,...)
Arguments
object: An object returned by glmnet_with_cv.
newdata: A data frame of new predictor values.
debias: Logical; if TRUE, applies the debiasing linear model stored in object$debias_fit (if available). Default is FALSE.
...: Additional arguments (not used).
Returns
A numeric vector of predictions.
Details
Predictions are computed by forming the model matrix from newdata using the stored formula and terms
in the fitted model object. The coefficients used are those stored in parms. If debias=TRUE and a debias_fit linear model is available, predictions are adjusted by that model.