knitr::opts_chunk$set( fig.path = "man/figures/", comment = NA )
Given predictions and a target variable, provide numerous statistics from the resulting confusion matrix. The goal is to provide a wealth of summary statistics that can be calculated from a single confusion matrix, and return tidy results with as few dependencies as possible.
library(confusionMatrix) p = sample(letters[1:2], 250, replace = T, prob = 1:2) o = sample(letters[1:2], 250, replace = T, prob = 1:2) result = confusion_matrix( prediction = p, target = o, return_table = TRUE ) result result$Accuracy$`Frequency Table`
result = confusion_matrix( prediction = p, target = o, longer = TRUE ) result
To install from GitHub the devtools package is required.
devtools::install_github('m-clark/confusionMatrix')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.