Travis-CI Build Status CRAN_Status_Badge

confusion2network

confusion2network is an R package that converts confusion matrix or classification predictions into confusion graph/network for performance investigation.

This package is still under active development and is subject to change, so documentation is lacking. But feel free to fork and send pull request. Use it with your own caution.


Installation

# install devtools if not
install.packages("devtools")
# install through github for now
devtools::install_github("qutang/confusion2network")

Highlight features

Example

require(confusion2network)

Confusion matrix as a graph

confusion2network(sample_confusion_matrix, 
                  true_label_prefix = "TRUE_", 
                  pred_label_prefix = "PREDICT_", 
                  height = "400px", 
                  width = "60%")

Prediction dataframe as a graph

Sample prediction matrix

head(sample_prediction_dataframe)

Convert prediction matrix to a network

prediction2network(sample_prediction_dataframe, 
                   true_col = "CLASS_ID", 
                   pred_col = "PRED_CLASS_ID",
                   true_labels = c("Transition", "Sitting", "Upright", "Lying"), 
                   pred_labels = c("Sitting", "Upright", "Lying"), 
                   height = "400px", 
                   width = "60%")

Acknowledge

visNetwork and vis.js is the backend for the interactive network building. Refer to their API for your own customization.



qutang/confusion2network documentation built on May 26, 2019, 1:31 p.m.