| fastCV2 {multiridge} | R Documentation |
Fast cross-validation per data block
Description
Fast cross-validation for high-dimensional data. Finds optimal penalties separately per data block. Useful for initialization.
Usage
fastCV2(XXblocks, Y, X1 = NULL, kfold = 10, intercept =
ifelse(is(Y, "Surv"), FALSE, TRUE), parallel = FALSE, fixedfolds = TRUE,
model = NULL, eps = 1e-10, reltol = 0.5, lambdamax= 10^6, traceCV=TRUE)
Arguments
XXblocks |
List of data frames or matrices, representing |
Y |
Response vector: numeric, binary, factor or |
X1 |
Matrix. Dimension |
kfold |
Integer. Desired fold. |
intercept |
Boolean. Should an intercept be included? |
parallel |
Boolean. Should computation be done in parallel? If |
fixedfolds |
Boolean. Should fixed splits be used for reproducibility? |
model |
Character. Any of |
eps |
Scalar. Numerical bound for IWLS convergence. |
reltol |
Scalar. Relative tolerance for optimization method. |
lambdamax |
Numeric. Upperbound for lambda. |
traceCV |
Boolean. Should the CV results be traced and printed? |
Details
This function is basically a wrapper for applying optLambdas per data block separately using Brent optimization.
Value
Numerical vector containing penalties optimized separately per data block. Useful for initialization.
See Also
optLambdas, optLambdasWrap which optimize the penalties jointly.
A full demo and data are available from:
https://drive.google.com/open?id=1NUfeOtN8-KZ8A2HZzveG506nBwgW64e4
Examples
data(dataXXmirmeth)
resp <- dataXXmirmeth[[1]]
XXmirmeth <- dataXXmirmeth[[2]]
cvperblock2 <- fastCV2(XXblocks=XXmirmeth,Y=resp,kfold=10,fixedfolds = TRUE)
lambdas <- cvperblock2$lambdas