cva.glmnet {nestedcv} | R 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), foldid = NULL, ...)
Arguments
x |
Matrix of predictors |
y |
Response vector |
nfolds |
Number of folds (default 10) |
alphaSet |
Sequence of alpha values to cross-validate |
foldid |
Optional vector of values between 1 and |
... |
Other arguments passed to glmnet::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 glmnet::cv.glmnet objects |
alphaSet |
Sequence of alpha values used |
alpha_cvm |
The mean cross-validated error - a vector of length
|
best_alpha |
Value of alpha giving lowest |
which_alpha |
Index of |
Author(s)
Myles Lewis
See Also
glmnet::cv.glmnet, glmnet::glmnet
[Package nestedcv version 0.7.9 Index]