Skip to content

MultiLabelConfusionMatrix

MultiLabelConfusionMatrix(labels=None) Multi-label Confusion Matrix.

Attributes

  • data

  • exact_match_cnt

  • jaccard_sum

  • labels

  • last_y_pred

  • last_y_true

  • n_labels

  • n_samples

  • precision_sum

  • recall_sum

  • sample_correction

  • shape

Methods

reset
revert

Parameters

  • y_true
  • y_pred
  • sample_weight
  • correction
update

Parameters

  • y_true
  • y_pred
  • sample_weight

Notes

This confusion matrix corresponds to a 3D matrix of shape `(n_labels, 2, 2)` meaning
that each `label` has a corresponding binary `(2x2)` confusion matrix.

The first dimension corresponds to the `label`, the second and third dimensions
are binary indicators for the `true` (actual) vs `predicted` values. For example,
an entry in position `[2, 0, 1]` represents a miss-classification of label 2.

This structure is used to keep updated statistics about a multi-output classifier's
performance and to compute multiple evaluation metrics.