ConfusionTableR – a package to tidy outputs of confusion matrix objects for storage in databases and row level structures

[This article was first published on R Blogs – Hutsons-hacks, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

I am really excited to announce my beta package and it is now available to download on GitHub.

This is my third package I have managed to create. I have many more projects, tutorials and code snippets available on my GitHub site.

I hope you find it useful and read below to find out how to install it, work with it and get the most out of it.

How to use the package?

The package guidance, and installation, can be found on the GitHub site directly, but to install the package follow the below steps:

library(ggplot)
# install.packages("remotes") # if not already installed
remotes::install_github("https://github.com/StatsGary/ConfusionTableR")
library(ConfusionTableR)

The vignette is avaialble for easy reference and will allow you to understand the process step by step.

Motivation for the package

The package aim is to make it easier to convert the outputs of the lists from caret and collapse these down into row-by-row entries, specifically designed for storing the outputs in a database or row by row data frame.

This is something that the CARET library does not have as a default and I have designed this to allow the confusion matrix outputs to be stored in a data frame or database, as many a time we want to track the ML outputs and fits over time to monitor feature slippage and changes in the underlying patterns of the data.

What’s included in the package?

The package contains three really useful functions:

  • BinaryFramer – this is to convert the elements of carets confusionMatrix() object into a database storable format
  • MultiFramer – this is to convert a mutli classification matrix output into a database storable format
  • BinaryVisualiseR – this creates a confusion matrix visualisation, currently only for binary classification tasks:

What’s next for the package?

I plan to keep working on this package to get it pushed up to CRAN, however there is no reason to stop you using this right away.

Feedback and testing

To enable any bugs to be fixed as soon as possible, then please make sure issues are raised on GitHub.

Closing remarks

I hope you find this package useful and please don’t hesitate to contact me directly if you want to collaborate or suggest new ideas for the package.

To leave a comment for the author, please follow the link and comment on their blog: R Blogs – Hutsons-hacks.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.