performancePlot | R Documentation |
Draws a graphical summary of a particular performance measure for a list of classifications
## S4 method for signature 'ClassifyResult'
performancePlot(results, ...)
## S4 method for signature 'list'
performancePlot(
results,
metric = "auto",
characteristicsList = list(x = "auto"),
aggregate = character(),
coloursList = list(),
alpha = 1,
orderingList = list(),
densityStyle = c("box", "violin"),
yLimits = NULL,
fontSizes = c(24, 16, 12, 12),
title = NULL,
margin = grid::unit(c(1, 1, 1, 1), "lines"),
rotate90 = FALSE,
showLegend = TRUE
)
results |
A list of |
... |
Not used by end user. |
metric |
Default: |
characteristicsList |
A named list of characteristics. Each element's
name must be one of |
aggregate |
A character vector of the levels of
|
coloursList |
A named list of plot aspects and colours for the aspects.
No elements are mandatory. If specified, each list element's name must be
either |
alpha |
Default: 1. A number between 0 and 1 specifying the transparency level of any fill. |
orderingList |
An optional named list. Any of the variables specified
to |
densityStyle |
Default: "box". Either |
yLimits |
The minimum and maximum value of the performance metric to plot. |
fontSizes |
A vector of length 4. The first number is the size of the
title. The second number is the size of the axes titles. The third number
is the size of the axes values. The fourth number is the font size of the
titles of grouped plots, if any are produced. In other words, when
|
title |
An overall title for the plot. |
margin |
The margin to have around the plot. |
rotate90 |
Logical. IF |
showLegend |
If |
If there are multiple values for a performance measure in a single result
object, it is plotted as a violin plot, unless aggregate
is
TRUE
, in which case the all predictions in a single result object are
considered simultaneously, so that only one performance number is
calculated, and a barchart is plotted.
An object of class ggplot
and a plot on the current graphics
device, if plot
is TRUE
.
Dario Strbenac
predicted <- DataFrame(sample = sample(LETTERS[1:10], 80, replace = TRUE),
permutation = rep(1:2, each = 40),
class = factor(rep(c("Healthy", "Cancer"), 40)))
actual <- factor(rep(c("Healthy", "Cancer"), each = 5))
result1 <- ClassifyResult(DataFrame(characteristic = c("Data Set", "Selection Name", "Classifier Name",
"Cross-validation"),
value = c("Example", "t-test", "Differential Expression", "2 Permutations, 2 Folds")),
LETTERS[1:10], paste("Gene", 1:100), list(paste("Gene", 1:100), paste("Gene", c(10:1, 11:100)), paste("Gene", 1:100), paste("Gene", 1:100)),
list(paste("Gene", 1:3), paste("Gene", c(2, 5, 6)), paste("Gene", 1:4), paste("Gene", 5:8)),
list(function(oracle){}), NULL, predicted, actual)
result1 <- calcCVperformance(result1, "Macro F1")
predicted <- DataFrame(sample = sample(LETTERS[1:10], 80, replace = TRUE),
permutation = rep(1:2, each = 40),
class = factor(rep(c("Healthy", "Cancer"), 40)))
result2 <- ClassifyResult(DataFrame(characteristic = c("Data Set", "Selection Name", "Classifier Name",
"Cross-validation"),
value = c("Example", "Bartlett Test", "Differential Variability", "2 Permutations, 2 Folds")),
LETTERS[1:10], paste("Gene", 1:100), list(paste("Gene", 1:100), paste("Gene", c(10:1, 11:100)), paste("Gene", 1:100), paste("Gene", 1:100)),
list(c(1:3), c(4:6), c(1, 6, 7, 9), c(5:8)),
list(function(oracle){}), NULL, predicted, actual)
result2 <- calcCVperformance(result2, "Macro F1")
performancePlot(list(result1, result2), metric = "Macro F1",
title = "Comparison")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.