深度学习模型评价指标——micro(微平均)/macro(宏平均)

最开始接触micro和macro是通过sklearn.metrics.precision_score,地址如下:precision_score,其中average参数的三个选项:micro、macro、weighted,说明如下。

'micro':
Calculate metrics globally by counting the total true positives, false negatives and false positives.

'macro':
Calculate metrics for each label, and find their unweighted mean. This does not take label imbalance into account.

'weighted':
Calculate metrics for each label, and find their average weighted by support (the number of true instances for each label). This alters ‘macro’ to account for label imbalance; it can result in an F-score that is not between precision and recall.

计算公式如下:
在这里插入图片描述
TP:True Positive,分类器预测结果为正样本,实际也为正样本,即正样本被正确识别的数量。

FP:False Positive,分类器预测结果为正样本,实际为负样本,即误报的负样本数量。

TN:True Negative,分类器预测结果为负样本,实际为负样本,即负样本被正确识别的数量。

FN:False Negative,分类器预测结果为负样本,实际为正样本,即漏报的正样本数量。

micro和weighted的计算方法类似,micro会根据样本类别的数量多少来相应的改变权重的大小,是以样本数量为主导的加权指标;weighted则不会考虑样本数量的多少,是以每一类样本数量在所有类样本总数中的占比作为权重。在micro指标下,样本的precision_score和recall都等于accuracy_scroe。

相关链接:
多分类任务的评价指标实现-正确率,真阳率/召回率/灵敏度,真阴率/特异度
多分类任务的混淆矩阵
通俗理解TP、FP、TN、FN
评价标准专题:常见的TP、TN、FP、FN和PR、ROC曲线

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值