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.

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.

n_samplesOptional[int] , default10000

Number of samples to use for the check. If None, all samples will be used.

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


ConfusionMatrixReport.add_condition(name, ...)

Add new condition function to the check.


Remove all conditions from this check instance.

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

Compute and plot confusion matrix after all batches were processed.


Run conditions on given result.


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.


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


Return check metadata.

Name of class in split camel case.


Return parameters to show when printing the check.


Remove given condition by index.[, ...])

Run check.

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

Serialize check instance to JSON string.

ConfusionMatrixReport.update(context, batch)

Add batch to confusion matrix.


Update the confusion matrix by batch for classification task.


Update the confusion matrix by batch for object detection task.