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