Learn R Programming

ClassifyR (version 1.6.2)

calcPerformance: Add Performance Calculations to a ClassifyResult object

Description

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

Usage

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

Value

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

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.

Examples

Run this code
  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)

Run the code above in your browser using DataLab