MCPcopy Create free account
hub / github.com/RozDavid/UnScene3D / plot_confusion_matrix

Function plot_confusion_matrix

utils/utils.py:593–609  ·  view source on GitHub ↗
(confusion_mat, class_names, title='Confusion Matrix')

Source from the content-addressed store, hash-verified

591 logging.info(debug_str)
592
593def plot_confusion_matrix(confusion_mat, class_names, title='Confusion Matrix'):
594 data = []
595 n_classes = confusion_mat.shape[0]
596
597 for i in range(n_classes):
598 for j in range(n_classes):
599 data.append([class_names[i], class_names[j], confusion_mat[i, j]])
600
601 fields = {
602 "Actual": "Actual",
603 "Predicted": "Predicted",
604 "nPredictions": "nPredictions",
605 }
606 return wandb.plot_table("wandb/confusion_matrix/v1",
607 wandb.Table(columns=["Actual", "Predicted", "nPredictions"], data=data),
608 fields,
609 {"title": title},)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected