View source: R/dCVnet_innerloop.R
repeated.cv.glmnet | R Documentation |
Repeatedly runs a cv.glmnet
and returns averaged
results. This is intended as a dCVnet internal function.
repeated.cv.glmnet(
x,
y,
folds = NULL,
lambda = NULL,
alpha = 1,
nfolds = NULL,
nreps = NULL,
family = c("gaussian", "binomial", "poisson", "multinomial", "cox", "mgaussian"),
...,
debug = FALSE
)
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 |
folds |
This is a list where each element is an integer vector of length n_cases. The integer for each case labels it as belonging to a fold 1:n_folds. This argument overrides the number of repeats and the k in repeated k-fold cv. |
lambda |
use a fixed, user supplied lambda sequence (descending)
see |
alpha |
The elasticnet mixing parameter, with
|
nfolds |
if folds are not specified, how many folds should be used in cross-validation? The default (nfolds=NULL) uses 10-fold. |
nreps |
if folds are not specified, how many times to repeat k-fold cross-validation? The default (nreps=NULL) uses 5 repeats. |
family |
Either a character string representing
one of the built-in families, or else a |
... |
arguments passed to |
debug |
return an unmerged list. |
The code will run for any glmnet family, but folds & lambdas must be correctly specified.
a cv.glmnet
object with cv performance averaged.
amalgamate_cv.glmnet
## Not run:
data("CoxExample", package = "glmnet") # x and y
mod <- repeated.cv.glmnet(x = CoxExample$x, y = CoxExample$y, family = "cox")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.