DTD_cv_lambda_R: Cross-validation for digital tissue deconvolution

View source: R/function_crossValidation.R

DTD_cv_lambda_RR Documentation

Cross-validation for digital tissue deconvolution

Description

Our descent generalized FISTA implementation includes a l1 regularization term (see train_deconvolution_model). This function performs a 'n.folds'-fold cross validation to find the best fitting regularization parameter.

Usage

DTD_cv_lambda_R(
  lambda.seq = "none",
  tweak.start,
  n.folds = 5,
  lambda.length = 10,
  train.data.list,
  cv.verbose = TRUE,
  warm.start = FALSE,
  F.GRAD.FUN,
  EVAL.FUN,
  ...
)

Arguments

lambda.seq

numeric vector or NULL or "none": Over this series of lambdas the FISTA will be optimized. If 'lambda.seq' is set to NULL, a generic series of lambdas - depending on the dimensions of the training set - will be generated. If 'lambda.seq' is "none", no cross validation is done. Only one model with lambda = 0 is trained on the complete data set.

tweak.start

numeric vector, starting vector for the DTD algorithm.

n.folds

integer, number of buckets in the cross validation.

lambda.length

integer, how many lambdas will be generated (only used if lambda.seq is NULL)

train.data.list

list, with two entries, a numeric matrix each, named 'mixtures' and 'quantities' Within this list the train/test cross validation will be done. (see Vignette 'browseVignettes("DTD")' for details)

cv.verbose

logical, should information about the cv process be printed to the screen?

warm.start

logical, should the solution of a previous model of the cross validation be used as start in the next model. Notice, that the warm.start starts with the most unpenalized model.

F.GRAD.FUN

gradient function, see descent_generalized_fista The 'F.GRAD.FUN' and 'EVAL.FUN' parameters are only present in the R cross validation. With these parameters an alternativ gradient, and evaluation function can be provided. Both functions are called using only the tweak vector as first argument.

EVAL.FUN

evaluation function, see descent_generalized_fista

...

all parameters that are passed to the descent_generalized_fista function. E.g. 'maxiter', 'NORM.FUN', 'cycles' etc ...

Details

For an example see 'browseVignettes("DTD")'.

Notice, there is an R and a C++ implementation of our optimizer. Hence, there are two cross validation implementations, calling either the R or C++ implementation: DTD_cv_lambda_R and DTD_cv_lambda_cxx.

Value

list of length 2:

  • 'cv.obj', list of lists. DTD model for each lambda, and every folds.

  • 'best.model', list. DTD model optimized on the complete data set with the best lambda from the cross validation.


MarianSchoen/DTD documentation built on April 29, 2022, 1:59 p.m.