Add Performance Calculations to a ClassifyResult object

Share:

Description

Annotates the results of calling runTests with different kinds of performance measures.

Usage

1
2
  ## S4 method for signature 'ClassifyResult'
calcPerformance(result, performanceType, ...)

Arguments

result

An object of class ClassifyResult.

performanceType

Either "balanced" or one of the options provided by performance.

...

Further arguments that may be used by performance.

Details

If runTests was run in resampling mode, one performance measure is produced for every resampling. If the leave-out mode was used, then the predictions are concatenated, and one performance measure is calcuated for all predictions.

Because ROCR only provides calculations for two-class classification, this function is only suitable for two-class classification performance measures.

Value

An updated ClassifyResult object, with new information in the performance slot.

Author(s)

Dario Strbenac

Examples

1
2
3
4
5
6
7
8
9
  predictTable <- data.frame(sample = 1:5,
                             label = factor(sample(LETTERS[1:2], 50, replace = TRUE)))
  actual <- factor(sample(LETTERS[1:2], 50, replace = TRUE))                             
  result <- ClassifyResult("Example", "Differential Expression", "A Selection",
                           paste("A", 1:10, sep = ''), paste("Gene", 1:50, sep = ''),
                           list(1:100, 1:100), list(1:5, 6:15),
                           list(predictTable), actual, list("leave", 2))
  result <- calcPerformance(result, "balanced") 
  performance(result)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.