Do k-fold cross-validation for glmaag
cv_glmaag(y, x, L, nfolds = 5, cvwhich, foldseed, stratify = T,
gam = 1, tune = F, est = T, lam1, lam2, dfmax, w0, adaptl1 = T,
adaptl2 = T, pind, intercept = T, standardize = T,
maxiter = 10000, cri = 0.001, fam = "Gaussian", measdev = T,
type1se = T, parallel = F)
outcome
predictors matrix
Laplacian matrix for the first network
number of folds used in cross validation, default to be five
fold assignment, start from zero, if missing do random cross validation
the random seed for cross validation design
whether to do stratified cross validation for Logistic or Cox model, default to be TRUE
The power of weights of L1 penalty, default to be ones
whether to tune the input network with estimated network or identity matrix, ignored if no input network
when there is no input network whether to use estimated network or identiy matrix (elastic net) or mixed the network with estimated network or identity matrix, default to be estimated network
The tuning parameters for L1 penalty. If not defined, searched by default
The tuning parameters for quadratic penalty. If not defined, searched by default
maximum number of parameters allowed in the model, default to be p/2
Weights for L1 penalty. If not defined, estimated via quadratic penalyzed regression
whether to adapt the L1 penalty, default to be TRUE
whether to adapt the sign for quadratic penalty, default to be TRUE
indicator vector whether to put L1 penalty on the feature, 1 means penalyzed while 0 means not penalyzed, default to be all ones (all penalyzed)
whether to include intercept. Ignore for Cox regression
whether to standardize predictors
maximum number of iterations, default to be 500
stoppint criterion, default to be 0.001
family for the outcome, can be "Gaussian", "Logistic", and "Cox"
Whether to use deviance to tune, default to be deviance. If not, use mean absolue error, area under ROC curve, or concordance index for Gaussian, Logistic, and Cox
whether to use one standard error or maximum rule, default to be one standard error rule
whether to do parallel computing at each fold, need to set up parallel first, default to be FALSE
input predictor matrix
estimated weights if mixing network
lambda1 path that has been searched
lambda1 path that has been searched
selected lambda1 based on maximum rule
selected lambda2 based on maximum rule
selected lambda1 based on one standard error rule
selected lambda2 based on one standard error rule
the mean cross validation accuracy
the standard error of cross validation accuracy
the mean number of parameter estimated among folds
number of selected features based on maximum rule
number of selected features based on one standard error rule
estimated intercept based on maximum rule
estimated intercept based on one standard error rule
estimated coefficients based on maximum rule
estimated coefficients based on one standard error rule
family of outcome
measure in cross validation
# NOT RUN {
data(sampledata)
data(L0)
y <- sampledata$Y_Gau
x <- sampledata[, -(1:3)]
cvwhich <- sample(rep(0:4, length.out = length(y)))
mod <- cv_glmaag(y, x, L0, cvwhich = cvwhich)
# }
Run the code above in your browser using DataLab