RunCrossValidation: Run cross validation for both alpha and lambda

View source: R/glmnet.R

RunCrossValidationR Documentation

Run cross validation for both alpha and lambda

Description

Run cross validation for both alpha and lambda

Usage

RunCrossValidation(
  x,
  y,
  groups,
  alpha.seq = c(0.1, 0.4, 0.7, 0.9, 0.95, 1),
  plot = T,
  n.cores = 4,
  family = "mgaussian",
  nlambda = 10,
  lambda.min.ratio = 0.01,
  nfolds = 4,
  seed = NULL,
  seq.lambda.pred = F
)

Arguments

x

Design matrix + covariates matrix

y

Expression response

groups

Perturbation dictionary (in list format) or named vector

alpha.seq

Sequence of alpha values to test

plot

Plot cross validation results (default: True)

n.cores

Number of cores to use (default: 4)

family

GLM family to use for elasticnet (default: mgaussian)

nlambda

Number of lambda values to test (default: 10)

lambda.min.ratio

Sets the minimum lambda value to test (default: 0.01)

nfolds

Number of folds to cross validate over (default: 5)

seed

Random seed for fold reproducibility

seq.lambda.pred

Predict expression at each lambda value sequentially to save memory (default: F)

Value

List of results containing cross validation objects (cv.list), cross validation summary stats (cv.summary), and the optimal lambda/alpha combo (alpha, lambda)


yanwu2014/perturbLM documentation built on Aug. 24, 2023, 2:28 p.m.