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.
# install devtools if not install.packages("devtools") # install through github for now devtools::install_github("qutang/confusion2network")
edge opacity and edge width
node click: click to highlight nodes and its up to 2 degree connections, indicating which classes may be misclassified with it.
require(confusion2network)
confusion2network(sample_confusion_matrix, true_label_prefix = "TRUE_", pred_label_prefix = "PREDICT_", height = "400px", width = "60%")
head(sample_prediction_dataframe)
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%")
visNetwork
and vis.js
is the backend for the interactive network building. Refer to their API for your own customization.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.