Learn R Programming

rTLsDeep (version 0.0.5)

gcmplot: Plot confusion matrix

Description

This function plots the confusion matrix for classification assessment

Usage

gcmplot(
  cm,
  colors = c(low = "white", high = "#009194"),
  title = "cm",
  prop = TRUE
)

Value

Returns an object of class gg and ggplot and plot of the confusion matrix.

Arguments

cm

An confusion matrix object of class "confusionMatrix". Output of the [rTLsDeep::confmatrix_damage()] function.

colors

A vector defining the low and high colors. Default is c(low="white", high="#009194").

title

A character defining the title of the figure.

prop

If TRUE percentage values will be plotted to the figure otherwise Freq.

Examples

Run this code

# Path to rds file
rdsfile <- system.file("extdata", "cm_vgg.rds", package="rTLsDeep")

# Read RDS fo;e
cm_vgg<-readRDS(rdsfile)

# Plot confusion matrix
gcmplot_vgg<-gcmplot(cm_vgg,
                    colors=c(low="white", high="#009194"),
                    title="densenet")

Run the code above in your browser using DataLab