cv_glmnet: Tuning parameter selection by cross-validation

Description Usage Arguments Value See Also

Description

Performs k-fold cross-validation for the first tuning parameter of elastic net (lambda) in the same way as cv.glmnet in the package glmnet and outputs the selected lambda and the cross-validation errors for individual folds.

Usage

1
2
cv_glmnet(X, Y, foldid, alpha = 1, error = "cox", offset = rep(0,
  nrow(X)), setlambda = F, lambda = 0, ...)

Arguments

X

The matrix of all predictors. Each row represents a subject and each column represents a feature.

Y

The survival time, represented by a Surv object.

foldid

A vector of integers between 1 and k indicating what fold each subject is in, where k is the number of folds.

alpha

The second tuning parameter in elastic net (α).

error

The choice of cross-validation error. Set error="cox" for deviance under the Cox model and error="Cindex" for the C-index.

offset

A vector of offset terms.

setlambda

If setlambda=TRUE, then a user-supplied vector of tuning parameters (λ) would be used; otherwise, the sequence would be chosen automatically.

lambda

The user-supplied sequence of tuning parameters (λ).

...

Other arguments that can be passed to glmnet.

Value

A list containing results of the cross-validation fit:

cvm

a vector of mean cross-validation errors over lambda values.

lambda

a vector of tuning parameter values.

df

a vector of mean numbers of variables selected over lambda values.

min.cvm

minimum value of mean cross-validation error.

lambda.min

the lambda value corresponding to the minimum (mean) cross-validation error.

min.pos

the position of the minimum (mean) cross-validation error in cvm.

all.beta

a list of estimated regression parameters over the folds.

all.cvm

a list of vectors of cross-validation errors over the folds.

See Also

glmnet


alexwky/I-Boost documentation built on May 3, 2019, 5:43 p.m.