exprso (version 0.1.8)

plGrid: Perform High-Throughput Classification

Description

Trains and deploys multiple classifiers across a vast parameter search space.

Usage

plGrid(array.train, array.valid = NULL, top, how, fold = 10,
  aucSkip = FALSE, verbose = TRUE, ...)

Arguments

array.train

Specifies the ExprsArray object to use as training set.

array.valid

Specifies the ExprsArray object to use as validation set.

top

A numeric scalar or character vector. A numeric scalar indicates the number of top features that should undergo feature selection. A character vector indicates specifically which features by name should undergo feature selection. Set top = 0 to include all features. Note that providing a numeric vector for the top argument will have plGrid search across multiple top features. However, by providing a list of numeric vectors as the top argument, the user can force the default handling of numeric vectors.

how

A character string. Specifies the build method to iterate.

fold

A numeric scalar. Specifies the number of folds for cross-validation. Set fold = 0 to perform leave-one-out cross-validation. Argument passed to plCV. Set fold = NULL to skip cross-validation altogether.

aucSkip

A logical scalar. Argument passed to calcStats.

verbose

A logical scalar. Argument passed to exprso-predict.

...

Arguments passed to the how method. Unlike the build method, plGrid allows multiple parameters for each argument, supplied as a vector. See Details.

Value

An ExprsPipeline-class object.

Details

plGrid will build and exprso-predict for each combination of parameters provided as additional arguments (...). When using plGrid, supplying a numeric vector as the top argument will train and deploy a classifier of each mentioned size for each combination of parameters provided in .... To skip validation set prediction, use array.valid = NULL. Either way, this function returns an ExprsPipeline-class object which contains the build parameters, classifier performances, and ExprsModel objects for all trained models.

plGrid will perform v-fold or leave-one-out cross-validation for the using plCV. The argument fold specifies the number of v-folds to use during cross-validation. Set fold = 0 to perform leave-one-out cross-validation. This approach to cross-validation will work for ExprsBinary and ExprsMulti objects alike. The peformance metric used to measure cross-validation accuracy is the acc slot returned by calcStats. Set fold = NULL to skip cross-validation altogether.

The use of plCV is most appropriate if the ExprsArray has not undergone any prior feature selection. However, it may also have a role as an unbiased guide to parameter selection when embedded in plGrid. If using cross-validation in lieu of an independent test set in the setting of one or more feature selection methods, consider using a more "sophisticated" form of cross-validation as implemented in plMonteCarlo or plNested.

See Also

fs build doMulti exprso-predict plCV plGrid plGridMulti plMonteCarlo plNested

Examples

Run this code
# NOT RUN {
require(golubEsets)
data(Golub_Merge)
array <- arrayEset(Golub_Merge, colBy = "ALL.AML", include = list("ALL", "AML"))
array <- modFilter(array, 20, 16000, 500, 5) # pre-filter Golub ala Deb 2003
array <- modTransform(array) # lg transform
array <- modNormalize(array, c(1, 2)) # normalize gene and subject vectors
arrays <- splitSample(array, percent.include = 67)
array.train <- fsStats(arrays[[1]], top = 0, how = "t.test")
pl <- plGrid(array.train, array.valid = arrays[[2]], how = "buildSVM",
             kernel = c("linear", "radial"), cost = 10^(-3:3), gamma = 10^(-3:3))
# }

Run the code above in your browser using DataCamp Workspace