predict.nestcv.glmnet {nestedcv}R Documentation

Predict method for nestcv.glmnet fits

Description

Obtains predictions from the final fitted model from a nestcv.glmnet object.

Usage

## S3 method for class 'nestcv.glmnet'
predict(object, newdata, s = object$final_param["lambda"], modify = FALSE, ...)

Arguments

object

Fitted nestcv.glmnet object

newdata

New data to predict outcome on

s

Value of lambda for glmnet prediction

modify

Logical whether to modify newdata based on modifyX function. See modifyX and modifyX_useY arguments in nestcv.glmnet().

...

Other arguments passed to predict.glmnet.

Details

Checks for missing predictors and if these are sparse (i.e. have zero coefficients) columns of 0 are automatically added to enable prediction to proceed.

Value

Object returned depends on the ... argument passed to predict method for glmnet objects.

See Also

glmnet::glmnet


[Package nestedcv version 0.7.9 Index]