Micro- and macro-averages
Micro- and macro-averages (for whatever metric) will compute slightly different things, and thus their interpretation differs.
A macro-average will compute the metric independently for each class and then take the average (hence treating all classes equally), whereas a micro-average will aggregate the contributions of all classes to compute the average metric. In a multi-class classification setup, micro-average is preferable if you suspect there might be class imbalance (i.e you may have many more examples of one class than of other classes).
To illustrate why, take for example precision Pr=TP(TP+FP)Pr=TP(TP+FP). Let's imagine you have a One-vs-All(there is only one correct class output per example) multi-class classification system with four classes and the following numbers when tested:
- Class A: 1 TP and 1 FP
- Class B: 10 TP and 90 FP
- Class C: 1 TP and 1 FP
- Class D: 1 TP and 1 FP
You can see easily that PrA=PrC=PrD=0.5PrA=PrC=PrD=0.5, whereas PrB=0.1PrB=0.1.
- A macro-average will then compute: Pr=0.5+0.1+0.5+0.54=0.4Pr=0.5+0.1+0.5+0.54=0.4
- A micro-average will compute: Pr=1+10+1+12+100+2+2=0.123Pr=1+10+1+12+100+2+2=0.123
These are quite different values for precision. Intuitively, in the macro-average the "good" precision (0.5) of classes A, C and D is contributing to maintain a "decent" overall precision (0.4). While this is technically true (across classes, the average precision is 0.4), it is a bit misleading, since a large number of examples are not properly classified. These examples predominantly correspond to class B, so they only contribute 1/4 towards the average in spite of constituting 94.3% of your test data. The micro-average will adequately capture this class imbalance, and bring the overall precision average down to 0.123 (more in line with the precision of the dominating class B (0.1)).
Micro- and macro-averages的更多相关文章
- F1 score,micro F1score,macro F1score 的定义
F1 score,micro F1score,macro F1score 的定义 2018年09月28日 19:30:08 wanglei_1996 阅读数 976 本篇博客可能会继续更新 最近在 ...
- 机器学习--Micro Average,Macro Average, Weighted Average
根据前面几篇文章我们可以知道,当我们为模型泛化性能选择评估指标时,要根据问题本身以及数据集等因素来做选择.本篇博客主要是解释Micro Average,Macro Average,Weighted A ...
- Micro和Macro性能学习【转载】
转自:https://datascience.stackexchange.com/questions/15989/micro-average-vs-macro-average-performance- ...
- 多分类评测标准(micro 和 macro)
- (转)Illustrated: Efficient Neural Architecture Search ---Guide on macro and micro search strategies in ENAS
Illustrated: Efficient Neural Architecture Search --- Guide on macro and micro search strategies in ...
- Java资源大全中文版(Awesome最新版)
Awesome系列的Java资源整理.awesome-java 就是akullpp发起维护的Java资源列表,内容包括:构建工具.数据库.框架.模板.安全.代码分析.日志.第三方库.书籍.Java 站 ...
- Java Bloom filter几种实现比较
英文原始出处: Bloom filter for Scala, the fastest for JVM 本文介绍的是用Scala实现的Bloom filter. 源代码在github上.依照性能测试结 ...
- 【Code Tools】Java微基准测试工具JMH之入门篇
一.JMH是什么 JMH是一个Java工具,用于构建.运行和分析用Java和其他语言编写的以JVM为目标的 nano/micro/milli/macro 基准测试. 二.基本注意事项 1)运行JMH基 ...
- [转]awsome-java
原文链接 Awesome Java A curated list of awesome Java frameworks, libraries and software. Contents Projec ...
- 多分类评价指标python代码
from sklearn.metrics import precision_score,recall_score print (precision_score(y_true, y_scores,ave ...
随机推荐
- free结果解释
free用于查询内存使用情况,不过其多个数值经常让人感到迷惑,下边对其结果各值进行解释. Mem 1862--总内存/1770--已使用内存/92--未使用内存/199--输出缓存/637--输入缓存 ...
- PHP -S命令 PHP内置web服务器
手册详细介绍 : http://www.php.net/manual/zh/features.commandline.webserver.php 适合本地开发 php 5.4.0起 这个内置的Web ...
- Linux第八周作业
一 理解编译链接的过程和ELF可执行文件格式 这张图说明了可执行程序的产生 大致过程为 .c文件汇编成汇编代码.asm, 然后再汇编成目标码.o, 然后链接成可执行文件a.out, 这时可执行文件就可 ...
- CAD绘制室外台阶步骤5.4
1.在CAD的平面上用PL命令绘制台阶,如图: 绘制好了之后.进入三维模型,“工具""移位”选择台阶,回车,"Z"回车,输入数值“-450”如图 2.输入命令“ ...
- loaclStorage、sessionStorage
这里需要注意的是这两种储存方式只能以字符串的形式来存取 html5中的Web Storage包括了两种存储方式:sessionStorage和localStorage.sessionStorage用于 ...
- 北邮新生排位赛2解题报告a-c
A. 丁神去谷歌 2014新生暑假个人排位赛02 时间限制 1000 ms 内存限制 65536 KB 题目描述 丁神要去Google上班了,去之前丁神想再做一道水题,但时间不多了,所以他希望题目做起 ...
- xadmin自定义关联菜单
网上好多自定义xadmin后台数据很少有关怎样设置外键关联菜单的显示,如下图所示: 现有个需求根据model中status字段值,来显示关联菜单三道杠,如上图app状态只有是审核成功才会显示,未审核不 ...
- Java反射《四》获取方法
package com.study.reflect; import java.lang.reflect.InvocationTargetException; import java.lang.refl ...
- bzoj2440
题解: 莫比乌斯反演 ans=sigma(x/(i*i)*miu[i]) 代码: #include<bits/stdc++.h> using namespace std; ; int T, ...
- nginx在linux上的安装与配置详解(一)
Nginx的安装与配置详解 (1)nginx简介 nginx概念: Nginx是一款轻量级的Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,并在一个BSD-like ...