Learn R Programming

MUVR2 (version 0.1.0)

rdCV: Wrapper for repeated double cross-validation without variable selection

Description

Wrapper for repeated double cross-validation without variable selection

Usage

rdCV(
  X,
  Y,
  ID,
  nRep = 5,
  nOuter = 6,
  nInner,
  DA = FALSE,
  fitness = c("AUROC", "MISS", "RMSEP", "BER"),
  method = c("PLS", "RF"),
  methParam,
  ML = FALSE,
  modReturn = FALSE,
  logg = FALSE
)

Value

An object containing stuff...

Arguments

X

Independent variables. NB: Variables (columns) must have names/unique identifiers. NAs not allowed in data. For ML, X is upper half only (X1-X2)

Y

Response vector (Dependent variable). For DA (classification), Y should be factor or character. For ML, Y is omitted. For regression, Y is numeric.

ID

Subject identifier (for sampling by subject; Assumption of independence if not specified)

nRep

Number of repetitions of double CV.

nOuter

Number of outer CV loop segments.

nInner

Number of inner CV loop segments.

DA

Logical for Classification (discriminant analysis) (Defaults do FALSE, i.e. regression). PLS is limited to two-class problems (see `Y` above).

fitness

Fitness function for model tuning (choose either 'AUROC' or 'MISS'or 'BER' for classification; or 'RMSEP' (default) for regression.)

method

Multivariate method. Supports 'PLS' and 'RF' (default)

methParam

List with parameter settings for specified MV method (defaults to ???)

ML

Logical for multilevel analysis (defaults to FALSE)

modReturn

Logical for returning outer segment models (defaults to FALSE)

logg

Logical for whether to sink model progressions to `log.txt`

Examples

Run this code
# \donttest{
data("freelive2")
nRep <- 2 # Number of MUVR2 repetitions
nOuter <- 4 # Number of outer cross-validation segments
varRatio <- 0.75 # Proportion of variables kept per iteration
method <- 'RF' # Selected core modeling algorithm
regrModel <- rdCV(X = XRVIP2,
                  Y = YR2,
                  nRep = nRep,
                  nOuter = nOuter,
                  method = method,
                  modReturn=TRUE)
# }

Run the code above in your browser using DataLab