Shortcuts

mmcls.core.calculate_confusion_matrix

mmcls.core.calculate_confusion_matrix(pred, target)[source]

Calculate confusion matrix according to the prediction and target.

Parameters
  • pred (torch.Tensor | np.array) – The model prediction with shape (N, C).

  • target (torch.Tensor | np.array) – The target of each prediction with shape (N, 1) or (N,).

Returns

Confusion matrix

The shape is (C, C), where C is the number of classes.

Return type

torch.Tensor

Read the Docs v: latest
Versions
master
latest
1.x
dev-1.x
Downloads
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.