ConfusionMatrixReport#

class ConfusionMatrixReport[source]#

Calculate the confusion matrix of the model on the given dataset.

For object detection, each detected bounding box calculates the IoU for each label and then that label class is used for the confusion matrix. detected bounding boxes that don’t match a label has their own class and same for labels without detected bounding boxes.

Parameters
categories_to_display (int, default 10):

Maximum number of categories to display

confidence_threshold (float, default 0.3):

Threshold to consider bounding box as detected.

iou_threshold (float, default 0.5):

Threshold to consider detected bounding box as labeled bounding box.

normalized (bool, default True):

boolean that determines whether to normalize the true values of the matrix.

__init__(categories_to_display: int = 10, confidence_threshold: float = 0.3, iou_threshold: float = 0.5, normalized: bool = True, **kwargs)[source]#
__new__(*args, **kwargs)#

Methods

ConfusionMatrixReport.add_condition(name, ...)

Add new condition function to the check.

ConfusionMatrixReport.clean_conditions()

Remove all conditions from this check instance.

ConfusionMatrixReport.compute(context[, ...])

Compute and plot confusion matrix after all batches were processed.

ConfusionMatrixReport.conditions_decision(result)

Run conditions on given result.

ConfusionMatrixReport.config([...])

Return check configuration (conditions' configuration not yet supported).

ConfusionMatrixReport.from_config(conf[, ...])

Return check object from a CheckConfig object.

ConfusionMatrixReport.from_json(conf[, ...])

Deserialize check instance from JSON string.

ConfusionMatrixReport.initialize_run(context)

Initialize run by creating an empty matrix the size of the data.

ConfusionMatrixReport.metadata([with_doc_link])

Return check metadata.

ConfusionMatrixReport.name()

Name of class in split camel case.

ConfusionMatrixReport.params([show_defaults])

Return parameters to show when printing the check.

ConfusionMatrixReport.remove_condition(index)

Remove given condition by index.

ConfusionMatrixReport.run(dataset[, model, ...])

Run check.

ConfusionMatrixReport.to_json([indent, ...])

Serialize check instance to JSON string.

ConfusionMatrixReport.update(context, batch)

Add batch to confusion matrix.

ConfusionMatrixReport.update_classification(...)

Update the confusion matrix by batch for classification task.

ConfusionMatrixReport.update_object_detection(...)

Update the confusion matrix by batch for object detection task.