View source: R/dCVnet_innerloop.R
multialpha.repeated.cv.glmnet | R Documentation |
Runs repeated.cv.glmnet
for a list of alpha values and
returns averaged results, selects the 'best' alpha.
One key difference between (repeated.)cv.glmnet and this function is
that a single 'best' lambda/alpha combination is identified
based on opt.lambda.type.
This is intended to be a dCVnet internal function
multialpha.repeated.cv.glmnet(
x,
y,
alphalist = round(seq(0.2, 1, len = 6)^exp(1), 2),
lambdas = NULL,
k = 10,
nrep = 5,
opt.lambda.type = c("min", "1se"),
opt.ystratify = TRUE,
opt.uniquefolds = FALSE,
opt.random_seed = NULL,
family,
opt.keep_models = c("best", "none", "all"),
...
)
x |
input matrix, of dimension nobs x nvars; each row is an observation
vector. Can be in sparse matrix format (inherit from class
|
y |
response variable. Quantitative for |
alphalist |
a vector of alpha values to search. |
lambdas |
a list of lambda sequence lists (corresponding to alphas given in alphalist) |
k |
the number of folds for k-fold cross-validation. |
nrep |
the number of repetitions |
opt.lambda.type |
Method for selecting optimum lambda. One of
|
opt.ystratify |
Boolean.
Outer and inner sampling is stratified by outcome.
This is implemented with |
opt.uniquefolds |
Boolean. In most circumstances folds will be unique. This requests that random folds are checked for uniqueness in inner and outer loops. Currently it warns if non-unique values are found. |
opt.random_seed |
Interpreted as integer. This is used to control the generation of random folds. |
family |
Either a character string representing
one of the built-in families, or else a |
opt.keep_models |
The models take up memory. What should we return?
|
... |
arguments passed to |
an object of class multialpha.repeated.cv.glmnet
.
Containing:
results - merged repeated.cv.glmnet
with
additional columns indicating alpha and logical for best overall
best - best selected row from results
folds - record of folds used
models - models requested by opt.keep_models.
bestmodel - index of the best model such that
models[[bestmodel]]
returns the model selected as optimal.
repeated.cv.glmnet
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.