fastCV: Fast, SVD-based cross-validation per data block

fastCVR Documentation

Fast, SVD-based cross-validation per data block

Description

Fast, SVD-based cross-validation for high-dimensional data. Finds optimal penalties separately per data block. Useful for initialization.

Usage

fastCV(Xblocks, Y, X1 = NULL, kfold = 10, intercept = ifelse(class(Y) == "Surv", FALSE, TRUE), parallel   = FALSE, fixedfolds = TRUE, model = NULL, eps = 1e-10, lambdamax= 10^6)

Arguments

Xblocks

List of data frames or matrices, representing b=1,...,B data blocks of dimensions n x p_b.

Y

Response vector: numeric, binary, factor or survival.

X1

Matrix. Dimension n x p_0, p_0 < n, representing unpenalized covariates.

kfold

Integer. Desired fold.

intercept

Boolean. Should an intercept be included?

parallel

Boolean. Should computation be done in parallel? If TRUE, requires to run setupParallel first.

fixedfolds

Boolean. Should fixed splits be used for reproducibility?

model

Character. Any of c("linear", "logistic", "cox"). Is inferred from Y when NULL.

eps

Scalar. Numerical bound for IWLS convergence.

lambdamax

Numeric. Upperbound for lambda.

Details

Note that this function requires loading the orphaned penalized package. This function is kept for reproducibility of results. Use fastCV2 if you do not have access to penalized.

Value

Numerical vector containing penalties optimized separately per data block. Useful for initialization. This function uses SVD for fast cross-validation.

See Also

optLambdas, optLambdasWrap which optimize the penalties jointly. fastCV2, which does not depend on the penalized package


markvdwiel/multiridge documentation built on June 21, 2022, 3:36 p.m.