View source: R/MultiLambdaCVfun.R
fastCV2 | R Documentation |
Fast cross-validation for high-dimensional data. Finds optimal penalties separately per data block. Useful for initialization.
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)
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? |
This function is basically a wrapper for applying optLambdas
per data block separately using Brent optimization.
Numerical vector containing penalties optimized separately per data block. Useful for initialization.
optLambdas
, optLambdasWrap
which optimize the penalties jointly.
A full demo and data are available from:
https://drive.google.com/open?id=1NUfeOtN8-KZ8A2HZzveG506nBwgW64e4
data(dataXXmirmeth) resp <- dataXXmirmeth[[1]] XXmirmeth <- dataXXmirmeth[[2]] cvperblock2 <- fastCV2(XXblocks=XXmirmeth,Y=resp,kfold=10,fixedfolds = TRUE) lambdas <- cvperblock2$lambdas
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.