Shortcuts

备注

您正在阅读 MMClassification 0.x 版本的文档。MMClassification 0.x 会在 2022 年末被切换为次要分支。建议您升级到 MMClassification 1.0 版本,体验更多新特性和新功能。请查阅 MMClassification 1.0 的安装教程迁移教程以及更新日志

mmcls.core.average_performance

mmcls.core.average_performance(pred, target, thr=None, k=None)[源代码]

Calculate CP, CR, CF1, OP, OR, OF1, where C stands for per-class average, O stands for overall average, P stands for precision, R stands for recall and F1 stands for F1-score.

参数
  • pred (torch.Tensor | np.ndarray) – The model prediction with shape (N, C), where C is the number of classes.

  • target (torch.Tensor | np.ndarray) – The target of each prediction with shape (N, C), where C is the number of classes. 1 stands for positive examples, 0 stands for negative examples and -1 stands for difficult examples.

  • thr (float) – The confidence threshold. Defaults to None.

  • k (int) – Top-k performance. Note that if thr and k are both given, k will be ignored. Defaults to None.

返回

(CP, CR, CF1, OP, OR, OF1)

返回类型

tuple

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

Free document hosting provided by Read the Docs.