cva.glmnet | R Documentation |
Performs k-fold cross-validation for glmnet, including alpha mixing parameter.
cva.glmnet(x, y, nfolds = 10, alphaSet = seq(0.1, 1, 0.1), foldid = NULL, ...)
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 |
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 |
Myles Lewis
glmnet::cv.glmnet, glmnet::glmnet
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.