ggClassPred: Barplot of the per class accuracies.

Description Usage Arguments Examples

View source: R/plots.R

Description

The ggClasPred function generates a barplot with the per class accuracies (%) for all the correctly classified and misclassified samples in the classification ensemble.

Usage

1
2
ggClassPred(ensObj, position = "stack", displayAll = FALSE, showText = FALSE, 
            xlabel = NULL, ylabel = NULL, cbPalette = FALSE, fillBrewer = FALSE)

Arguments

ensObj

The classification ensemble (in the form of an R list) as generated by cfBuild

position

The position may be equal to either "stack" or "dodge".

displayAll

Boolean value, by default set to FALSE. When displayAll= FALSE, only the percentages of correctly classified samples are displayed in the barplot. If displayAll = TRUE, the percentages of all classified and missclassified samples are depicted in the barplot.

showText

Boolean value, by default set to FALSE. If showText=TRUE, then the per class accuracies (%) for all classifiers in the ensemble are displayed in the plot.

xlabel

A sub title for the x axis (optional field).

ylabel

A sub title for the y axis (optional field).

cbPalette

If TRUE, enable a color-blind-friendly palette.

fillBrewer

If TRUE, enable a color scale taken from the RColorBrewer package.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Not run: 
data(iris)

irisClass <- iris[,5]
irisData  <- iris[,-5]
            
ens <- cfBuild(irisData, irisClass, bootNum = 100, ensNum = 100, parallel = TRUE, 
               cpus = 4, type = "SOCK")

# Show the percentages of correctly classified samples in 
# a barplot with or without text respectively

ggClassPred(ens)
ggClassPred(ens, showText = TRUE)

# Show the percentages of classified and missclassified samples
# in a barplot simultaneously with and without text

ggClassPred(ens, displayAll = TRUE)
ggClassPred(ens, position="stack", displayAll = TRUE)
ggClassPred(ens, position="stack", displayAll = TRUE, showText = TRUE)

# Alernatively, using a dodge position
ggClassPred(ens, position = "dodge", displayAll = TRUE)
ggClassPred(ens, position = "dodge", displayAll = TRUE, showText = TRUE)

## End(Not run)

classyfire documentation built on May 29, 2017, 11:05 p.m.