ClassifyResult {ClassifyR} | R Documentation

## Container for Storing Classification Results

### 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, selectionName, originalNames, originalFeatures,
                 rankedFeatures, chosenFeatures, predictions, actualClasses, models,
                 validation, tune = list(NULL))

`datasetName`

  A name associated with the dataset used.

`classificationName`

  A name associated with the classification.

`seletionName`

  A name associated with the feature selection.

`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.

`models`

  All of the models fitted to the training data.

`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.

`models(result)`

  A `list` of the models fitted 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

      #if(require(sparsediscrim))
      #{
        data(asthma)

        resubstituteParams <- ResubstituteParams(nFeatures = seq(5, 25, 5),
                                             performanceType = "balanced error",
                                             better = "lower")
        classified <-
        runTests(measurements, classes, datasetName = "Asthma",
                 classificationName = "Different Means", validation = "leaveOut", leave = 1,
                 params = list(SelectParams(limmaSelection, "Moderated t Statistic",
                                            resubstituteParams = resubstituteParams),
                               TrainParams(DLDAtrainInterface),
                               PredictParams(DLDApredictInterface)))
        class(classified)
      #}

[Package ClassifyR version 2.12.0 Index]