ClassifyResult-class: Container for Storing Classification Results

Description Constructor Summary Accessors Author(s) Examples

Description

Contains a table of actual sample classes and predicted classes, the identifiers of features selected for each fold of each permutation or each hold-out classification, and error rates. This class is not intended to be created by the user, but could be used in another package. It is created by runTests.

Constructor

ClassifyResult(datasetName, classificationName, originalNames, originalFeatures,
           rankedFeatures, chosenFeatures, predictions, actualClasses,
           validation, tune = list(NULL))
datasetName

A name associated with the data set used.

classificationName

A name associated with the classification.

originalNames

All sample names.

originalFeatures

All feature names. Character vector or DataFrame with one row for each feature if the data set is a MultiAssayExperiment.

rankedFeatures

All features, from most to least important. Character vector or DataFrame if data set is a MultiAssayExperiment.

chosenFeatures

Features selected at each fold. Character vector or DataFrame if data set is a MultiAssayExperiment.

predictions

A list of data.frame containing information about samples, their actual class and predicted class.

actualClasses

Factor of class of each sample.

validation

List with first element being the name of the validation scheme, and other elements providing details about the scheme.

tune

A description of the tuning parameters, and the value chosen of each parameter.

Summary

A method which summarises the results is available. result is a ClassifyResult object.

show(result)Prints a short summary of what result contains.

totalPredictions(ClassifyResult)Calculates the sum of the number of predictions.

Accessors

result is a ClassifyResult object.

sampleNames(result)

Returns a vector of sample names present in the data set.

featureNames(result)

Returns a vector of features present in the data set.

predictions(result)

Returns a list of data.frame. Each data.frame contains columns sample, predicted, and actual. For hold-out validation, only one data.frame is returned of all of the concatenated predictions.

actualClasses(result)

Returns a factor class labels, one for each sample.

features(result)

A list of the features selected for each training.

performance(result)

Returns a list of performance measures. This is empty until calcCVperformance has been used.

tunedParameters(result)

Returns a list of tuned parameter values. If cross-validation is used, this list will be large, as it stores chosen values for every iteration.

sampleNames(result)

Returns a character vector of sample names.

Author(s)

Dario Strbenac

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
  if(require(sparsediscrim))
  {
    data(asthma)
    
    resubstituteParams <- ResubstituteParams(nFeatures = seq(5, 25, 5),
                                         performanceType = "balanced error",
                                         better = "lower")
    classified <-
    runTests(measurements, classes, "Asthma", "Different Means",
             permutations = 5,
             params = list(SelectParams(limmaSelection, "Moderated t Statistic",
                                        resubstituteParams = resubstituteParams),
                           TrainParams(DLDAtrainInterface),
                           PredictParams(DLDApredictInterface,
                                         getClasses = function(result) result[["class"]])))
    class(classified)
  }

ClassifyR documentation built on June 20, 2018, 2 a.m.