predict.cv.glmnet: make predictions from a "cv.glmnet" object.

Description

This function makes predictions from a cross-validated glmnet model,
using the stored "glmnet.fit" object, and the optimal value
chosen for lambda.

Usage

# S3 method for cv.glmnet
predict(object, newx, s=c("lambda.1se","lambda.min"),...)
# S3 method for cv.glmnet
coef(object,s=c("lambda.1se","lambda.min"),...)

Arguments

object

Fitted "cv.glmnet" object.

newx

Matrix of new values for x at which predictions are
to be made. Must be a matrix; can be sparse as in Matrix
package. See documentation for predict.glmnet.

s

Value(s) of the penalty parameter lambda at which
predictions are required. Default is the value s="lambda.1se" stored
on the CV object. Alternatively s="lambda.min" can be
used. If s is numeric, it is taken as the value(s) of
lambda to be used.

…

Not used. Other arguments to predict.

Value

The object returned depends the … argument which is passed on
to the predict method for glmnet objects.

Details

This function makes it easier to use the results of
cross-validation to make a prediction.