Module epiclass.utils.create_confusion_matrices

This Python script is intended to merge or create confusion matrices. It uses the epiclass library's ConfusionMatrixWriter for tasks related to confusion matrices.

Command line arguments. It expects '–from_existing' to combine CSV matrices or '–from_prediction' to convert a classification prediction file into a confusion matrix.

Note: The prediction file used by the "from_prediction" option must at least have 'True class' and 'Predicted class' headers to generate the confusion matrix. Other columns, if present, will be ignored.

Functions

def add_matrices(logdir: str)

Add several matrices together from folds.

def main()

Augment a label prediction file with new metadata categories.

File header format important. Expects [md5sum, true class, predicted class, labels] lines.

def parse_arguments() ‑> argparse.Namespace

Return argument line parser.