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

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:

1
2
3
4
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.

Leave a Reply