cva.glmnet: Cross-validation of alpha for glmnet

View source: R/nestedcv.R

cva.glmnetR Documentation

Cross-validation of alpha for glmnet

Description

Performs k-fold cross-validation for glmnet, including alpha mixing parameter.

Usage

cva.glmnet(x, y, nfolds = 10, alphaSet = seq(0.1, 1, 0.1), ...)

Arguments

x

Matrix of predictors

y

Response vector

nfolds

Number of folds (default 10)

alphaSet

Sequence of alpha values to cross-validate

...

Other arguments passed to cv.glmnet

Value

Object of S3 class "cva.glmnet", which is a list of the cv.glmnet objects for each value of alpha and alphaSet.

fits

List of fitted cv.glmnet objects

alphaSet

Sequence of alpha values used

alpha_cvm

The mean cross-validated error - a vector of length length(alphaSet).

best_alpha

Value of alpha giving lowest alpha_cvm.

which_alpha

Index of alphaSet with lowest alpha_cvm

Author(s)

Myles Lewis

See Also

cv.glmnet, glmnet


nestedcv documentation built on Oct. 23, 2022, 5:06 p.m.