Learn R Programming

ClassifyR (version 1.6.2)

runTest: Perform a Single Classification

Description

For a dataset of features and samples, the classification process is run. It consists of data transformation, feature selection, training and testing.

Usage

"runTest"(expression, classes, ...) "runTest"(expression, datasetName, classificationName, training, testing, params = list(SelectParams(), TrainParams(), PredictParams()), verbose = 1, .iteration = NULL)

Arguments

expression
Either a matrix or ExpressionSet containing the training data. For a matrix, the rows are features, and the columns are samples.
classes
A vector of class labels.
datasetName
A name associated with the dataset used.
classificationName
A name associated with the classification.
training
A vector which specifies the training samples.
testing
A vector which specifies the test samples.
params
A list of objects of class of TransformParams, SelectParams, TrainParams, or PredictParams. The order they are in the list determines the order in which the stages of classification are done in.
...
Unused variables from the matrix method passed to the ExpressionSet method.
verbose
A number between 0 and 3 for the amount of progress messages to give. A higher number will produce more messages.
.iteration
Not to be set by a user. This value is used to keep track of the cross-validation iteration, if called by runTests.

Value

A named list with five elements. The first element contains all of the features, ranked from most important to least important. The second element contains the indices of genes that were selected by the feature selection step. The third element contains the indices of the samples that were in the test set. The fourth element contains a vector of the classes predicted by the classifer. The fifth element contains the value of any tuning parameters tried and chosen.

Details

This function only performs one classification and prediction. See runTests for a driver function that does cross validation and uses this function. datasetName and classificationName need to be provided.

Examples

Run this code
  if(require(curatedOvarianData) && require(sparsediscrim))
  {
    data(TCGA_eset)
    badOutcome <- which(pData(TCGA_eset)[, "vital_status"] == "deceased" & pData(TCGA_eset)[, "days_to_death"] <= 365)
    goodOutcome <- which(pData(TCGA_eset)[, "vital_status"] == "living" & pData(TCGA_eset)[, "days_to_death"] >= 365 * 5)
    TCGA_eset <- TCGA_eset[, c(badOutcome, goodOutcome)]
    classes <- factor(rep(c("Poor", "Good"), c(length(badOutcome), length(goodOutcome))))
    pData(TCGA_eset)[, "class"] <- classes
    runTest(TCGA_eset, "Ovarian Cancer", "Differential Expression",
            training = (1:ncol(TCGA_eset)) %% 2 == 0,
            testing = (1:ncol(TCGA_eset)) %% 2 != 0)
  }

Run the code above in your browser using DataLab