Precision and recall

Precision and Recall Precision and Recall 2012 年 05 月 20 日 Precision and Recall是評估測量 (Evaluation Measurement)的方法之一,特別是在資訊檢索和資料探勘這兩個領域,我們想知道下query後系統的效能如何,系統回傳的結果是不是使用者想要的。 Precision and Re 阅读详情

原文转载于: http://en.wikipedia.org/wiki/Precision_and_recall


In pattern recognition and information retrieval, precision (also called positive predictive value) is the fraction of retrieved instances that are relevant, while recall (also known as sensitivity) is the fraction of relevant instances that are retrieved. Both precision and recall are therefore based on an understanding and measure of relevance. Suppose a program for recognizing dogs in scenes from a video identifies 7 dogs in a scene containing 9 dogs and some cats. If 4 of the identifications are correct, but 3 are actually cats, the program's precision is 4/7 while its recall is 4/9. When a search engine returns 30 pages only 20 of which were relevant while failing to return 40 additional relevant pages, its precision is 20/30 = 2/3 while its recall is 20/60 = 1/3.

In statistics, if the null hypothesis is that all and only the relevant items are retrieved, absence of type I and type II errors corresponds respectively to maximum precision (no false positives) and maximum recall (no false negatives). The above pattern recognition example contained 7 − 4 = 3 type I errors and 9 − 4 = 5 type II errors. Precision can be seen as a measure of exactness or quality, whereas recall is a measure of completeness or quantity.

In simple terms, high recall means that an algorithm returned most of the relevant results, while high precision means that an algorithm returned substantially more relevant results than irrelevant.

Introduction[edit source | editbeta]

As an example, in an information retrieval scenario, the instances are documents and the task is to return a set of relevant documents given a search term; or equivalently, to assign each document to one of two categories, "relevant" and "not relevant". In this case, the "relevant" documents are simply those that belong to the "relevant" category. Recall is defined as the number of relevant documents retrieved by a search divided by the total number of existing relevant documents, while precision is defined as the number of relevant documents retrieved by a search divided by the total number of documents retrieved by that search.

In a classification task, the precision for a class is the number of true positives (i.e. the number of items correctly labeled as belonging to the positive class) divided by the total number of elements labeled as belonging to the positive class (i.e. the sum of true positives and false positives, which are items incorrectly labeled as belonging to the class). Recall in this context is defined as the number of true positives divided by the total number of elements that actually belong to the positive class (i.e. the sum of true positives and false negatives, which are items which were not labeled as belonging to the positive class but should have been).

In information retrieval, a perfect precision score of 1.0 means that every result retrieved by a search was relevant (but says nothing about whether all relevant documents were retrieved) whereas a perfect recall score of 1.0 means that all relevant documents were retrieved by the search (but says nothing about how many irrelevant documents were also retrieved).

In a classification task, a precision score of 1.0 for a class C means that every item labeled as belonging to class C does indeed belong to class C (but says nothing about the number of items from class C that were not labeled correctly) whereas a recall of 1.0 means that every item from class C was labeled as belonging to class C (but says nothing about how many other items were incorrectly also labeled as belonging to class C).

Often, there is an inverse relationship between precision and recall, where it is possible to increase one at the cost of reducing the other. Brain surgery provides an obvious example of the tradeoff. Consider a brain surgeon tasked with removing a cancerous tumor from a patient’s brain. The surgeon needs to remove all of the tumor cells since any remaining cancer cells will regenerate the tumor. Conversely, the surgeon must not remove healthy brain cells since that would leave the patient with impaired brain function. The surgeon may be more liberal in the area of the brain she removes to ensure she has extracted all the cancer cells. This decision increases recall but reduces precision. On the other hand, the surgeon may be more conservative in the brain she removes to ensure she extracts only cancer cells. This decision increases precision but reduces recall. That is to say, greater recall increases the chances of removing healthy cells (negative outcome) and increases the chances of removing all cancer cells (positive outcome). Greater precision decreases the chances of removing healthy cells (positive outcome) but also decreases the chances of removing all cancer cells (negative outcome).

Usually, precision and recall scores are not discussed in isolation. Instead, either values for one measure are compared for a fixed level at the other measure (e.g. precision at a recall level of 0.75) or both are combined into a single measure, such as their harmonic mean the F-measure, which is the weighted harmonic mean of precision and recall (see below), or the Matthews correlation coefficient, which is the geometric mean of the regression coefficients Informedness (DeltaP') and Markedness (DeltaP).[1][2] Accuracy is a weighted arithmetic mean of Precision and Inverse Precision (weighted by Bias) as well as a weighted arithmetic mean of Recall and Inverse Recall (weighted by Prevalence).[1] Inverse Precision and Recall are simply the Precision and Recall of the inverse problem where positive and negative labels are exchanged (for both real classes and prediction labels). Recall and Inverse Recall, or equivalently true positive rate and false positive rate, are frequently plotted against each other as ROC curves and provide a principled mechanism to explore operating point tradeoffs. Outside of Information Retrieval, the application of Recall, Precision and F-measure are argued to be flawed as they ignore the true negative cell of the contingency table, and they are easily manipulated by biasing the predictions.[1] The first problem is 'solved' by using Accuracy and the second problem is 'solved' by discounting the chance component and renormalizing toCohen's kappa, but this no longer affords the opportunity to explore tradeoffs graphically. However, Informedness and Markedness are Kappa-like renormalizations of Recall and Precision,[3] and their geometric mean Matthews correlation coefficientthus acts like a debiased F-measure.

Definition (information retrieval context)[edit source | editbeta]

In information retrieval contexts, precision and recall are defined in terms of a set of retrieved documents (e.g. the list of documents produced by a web search engine for a query) and a set of relevant documents (e.g. the list of all documents on the internet that are relevant for a certain topic), cf. relevance.

Precision[edit source | editbeta]

In the field of information retrieval, precision is the fraction of retrieved documents that are relevant to the search:

 \text{precision}=\frac{|\{\text{relevant documents}\}\cap\{\text{retrieved documents}\}|}{|\{\text{retrieved documents}\}|}

Precision takes all retrieved documents into account, but it can also be evaluated at a given cut-off rank, considering only the topmost results returned by the system. This measure is called precision at n or P@n.

For example for a text search on a set of documents precision is the number of correct results divided by the number of all returned results.

Precision is also used with recall, the percent of all relevant documents that is returned by the search. The two measures are sometimes used together in the F1 Score (or f-measure) to provide a single measurement for a system.

Note that the meaning and usage of "precision" in the field of Information Retrieval differs from the definition of accuracy and precision within other branches of science and technology.

Recall[edit source | editbeta]

Recall in information retrieval is the fraction of the documents that are relevant to the query that are successfully retrieved.

 \text{recall}=\frac{|\{\text{relevant documents}\}\cap\{\text{retrieved documents}\}|}{|\{\text{relevant documents}\}|}

For example for text search on a set of documents recall is the number of correct results divided by the number of results that should have been returned

In binary classification, recall is called sensitivity. So it can be looked at as the probability that a relevant document is retrieved by the query.

It is trivial to achieve recall of 100% by returning all documents in response to any query. Therefore, recall alone is not enough but one needs to measure the number of non-relevant documents also, for example by computing the precision.

Definition (classification context)[edit source | editbeta]

For classification tasks, the terms true positives, true negatives, false positives, and false negatives (see also Type I and type II errors) compare the results of the classifier under test with trusted external judgments. The terms positive andnegative refer to the classifier's prediction (sometimes known as the expectation), and the terms true and false refer to whether that prediction corresponds to the external judgment (sometimes known as the observation). This is illustrated by the table below:

 actual class
(observation)
 
predicted class
(expectation)
tp
(true positive)
Correct result
fp
(false positive)
Unexpected result
fn
(false negative)
Missing result
tn
(true negative)
Correct absence of result

Precision and recall are then defined as:[4]

\text{Precision}=\frac{tp}{tp+fp} \,
\text{Recall}=\frac{tp}{tp+fn} \,

Recall in this context is also referred to as the True Positive Rate or Sensitivity, and precision is also referred to as Positive predictive value (PPV); other related measures used in classification include True Negative Rate and Accuracy.[4] True Negative Rate is also called Specificity.

\text{True negative rate}=\frac{tn}{tn+fp} \,
\text{Accuracy}=\frac{tp+tn}{tp+tn+fp+fn} \,

Probabilistic interpretation[edit source | editbeta]

It is possible to interpret precision and recall not as ratios but as probabilities:

  • Precision is the probability that a (randomly selected) retrieved document is relevant.
  • Recall is the probability that a (randomly selected) relevant document is retrieved in a search.

Note that the random selection refers to a uniform distribution over the appropriate pool of documents; i.e. by randomly selected retrieved document, we mean selecting a document from the set of retrieved documents in a random fashion. The random selection should be such that all documents in the set are equally likely to be selected.

Note that, in a typical classification system, the probability that a retrieved document is relevant depends on the document. The above interpretation extends to that scenario also (needs explanation).

Another interpretation for precision and recall is as follows. Precision is the average probability of relevant retrieval. Recall is the average probability of complete retrieval. Here we average over multiple retrieval queries.

F-measure[edit source | editbeta]

A measure that combines precision and recall is the harmonic mean of precision and recall, the traditional F-measure or balanced F-score:

F = 2 \cdot \frac{\mathrm{precision} \cdot \mathrm{recall}}{ \mathrm{precision} + \mathrm{recall}}

This is also known as the F_1 measure, because recall and precision are evenly weighted.

It is a special case of the general F_\beta measure (for non-negative real values of \beta):

F_\beta = (1 + \beta^2) \cdot \frac{\mathrm{precision} \cdot \mathrm{recall} }{ \beta^2 \cdot \mathrm{precision} + \mathrm{recall}}

Two other commonly used F measures are the F_2 measure, which weights recall higher than precision, and the F_{0.5} measure, which puts more emphasis on precision than recall.

The F-measure was derived by van Rijsbergen (1979) so that F_\beta "measures the effectiveness of retrieval with respect to a user who attaches \beta times as much importance to recall as precision". It is based on van Rijsbergen's effectiveness measure E = 1 - \frac{1}{\frac{\alpha}{P} + \frac{1-\alpha}{R}}. Their relationship is F_\beta = 1 - E where \alpha=\frac{1}{1 + \beta^2}.


论文速看 Improved Precision and Recall Metric for Assessing Generative Models 来自StyleGAN团队的准确率和召回率指标。 阅读详情

相关推荐

解放双手!利用海康VM全局脚本+通讯管理打造自动化视觉控制系统

本文深入探讨了如何利用海康VisionMaster(VM)的全局脚本和通讯管理功能,打造高效自动化视觉控制系统。通过全局变量实现数据共享与动态调整,结合多协议通讯管理,提升系统响应速度与智能化水平,适用于工业4.0环境下的复杂视觉检测与决策场景。

weixin_28720573的博客 424

Precision(准确率)和Recall(召回率)介绍

为什么我们需要Precision(准确率)和Recall(召回率)? 首先我们仅仅只看loss的话,会出现什么问题。 举个例子:比如对于一个二分类的模型,我们通过训练得到最终loss仅为5%,也就是准确率达到了95%,这很明显我们认为这是一个比较优秀的模型。 但是,如果我们的训练数据,仅有3%的数据对应标签为0,也就是负样本,其余均为正样本,对应标签为1. 这样会发生什么?如果我们的网络只能输出1,无论输入是什么,都只能输出1,这...

weixin_42638415的博客 4万+

D触发器(D Flip-Flop)与D锁存器(D Latch)

在解释这个练习题之前,我们先来简单回顾一下D触发器(D flip-flop)和D锁存器(D latch)的概念,以及它们在数字电路中的作用。这将帮助我们理解所提到的练习。

weixin_65190179的博客 9170

precision and recall

首先强调multi-class 和multi-label是不同的,前者是每个样本只属于一个类别,后者是每个样本可以有多个类别标记,即多个类别在模式识别,信息检索,二分类等问题中常常需要对结果进行评价,评价的几个指标通常是准确率(accuracy),精确率(precision)和召回率(recall)1、分类问题举个二分类的问题,类别狗为正,猫为负。测试用例12只动物,7只狗,5只猫。识别出8只狗,...

u012836354的博客 5445

android 运动目标检测_MindSpore应用案例:AI对篮球运动员目标的检测

MindSpore作为一个端边云协同的开源的全场景AI框架,今年3月份开源以来,受到了业界的广泛关注和应用,欢迎大家参与开源贡献、模型众智合作、行业创新与应用、学术合作等,贡献您在云侧、端侧 (HiMindSpore 应用程序)、边侧以及安全领域的应用案例。MindSpore与您在AI领域共同成长,让AI使能千行百业,释放出强大的生产力。本文讲述的是MindSpore对篮球运动员目标的检测应用,通...

weixin_33603813的博客 835

关键词‖旋变传感器

旋转变压器(以下简称旋变)安装在永磁同步驱动电机的非传动端,其作用是检测转子的位置和速度。目前,通常采采用结构简单、坚固耐用、环境适应性好的磁阻式旋变作为位置传感器。

m0_72345077的博客 2151

“Precision“ and “Recall“

一般来说,Precision和Recall是相互影响的。如果我们想要提高Precision,就可能降低Recall;如果我们想要提高Recall,就可能降低Precision。这是因为,提高模型的判断标准可以提高Precision,但是也会漏掉一些真正的正例,降低Recall。假设我们有一个模型,用来判断一封邮件是否是垃圾邮件。

qq_52060318的博客 393

2026年北京君正数字IC笔试试卷带答案

本文摘要:该文档是一份数字IC设计相关的考试试题,包含单选题、多选题、波形分析题和代码设计题。内容涵盖时序约束、半导体工艺、状态机设计、逻辑综合、异步FIFO设计等知识点。试题解析详细,重点考察数字电路基础、时序分析和Verilog代码实现能力。典型题目包括多周期路径设置、Moore/Mealy状态机区别、同步复位与异步复位特性、RISC-V架构特点等,并提供了异步FIFO的Verilog实现参考代码。(149字)

Open 113

Precision和Recall

和是评估分类模型性能的两个重要指标,它们虽然都与模型的正确性相关,但关注的角度和用途有所不同。

weixin_43455016的博客 2893

Android面试必考问题:Android性能优化最全面试题及参考答案(8万字长文)

Android 中的 OOM(Out Of Memory,内存溢出)异常是指应用程序在运行过程中,由于申请的内存空间超过了系统所能提供的最大内存限制而导致的错误。在 Android 中,内存泄漏是指应用中的某些对象在不再被使用后,仍然被其他对象持有引用,导致这些对象无法被垃圾回收器回收,从而占用内存空间,随着时间的推移可能会导致应用内存不足,甚至崩溃。在一次开发 Android 应用的过程中,我发现应用在长时间运行后会出现内存占用过高的情况,导致应用变得卡顿,甚至可能会被系统强制关闭。

大模型大数据攻城狮的专栏 2532

【C语言】一文带你拿捏分支和循环语句(一万字详细讲解)

if/switch语句、while/fo/do...while循环语句、goto语句详解

StackFrame 1233

Precision (精确率) 和 Recall (召回率)

Precision (精确率) 和 Recall (召回率) 是机器学习中的两个重要指标,用于评估分类模型的性能。精确率指预测为正的样本中真正为正的样本占比,召回率指真正为正的样本中被正确地预测为正的样本占比。其中,TP 表示真正为正的样本预测为正,FP 表示真正为负的样本预测为正,FN 表示真正为正的样本预测为负。通常情况下,精确率和召回率是相互矛盾的,提高精确率会降低召回率,反之亦然。

weixin_51976215的博客 1万+

国科大学习资料--矩阵论(叶世伟)-期末考试题整理3

国科大学习资料–矩阵论-期末考试题整理3 国科大学习资料–矩阵论-期末考试题整理3 国科大学习资料–矩阵论-期末考试题整理3

无名何许人的博客 1404

recall and precision

通俗的讲,Precision 就是检索出来的条目中(比如网页)有多少是准确的,Recall就是所有准确的条目有多少被检索出来了 以为检索为例: 相关 不相关 检索到 A B 未检索到 C D A:检索到的,相关的

jiaobei2354717的专栏 637

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

Precision and Recall[转]

原文出自:http://blog.youkuaiyun.com/wangran51/article/details/7579100 最近一直在做相关推荐方面的研究与应用工作,召回率与准确率这两个概念偶尔会遇到, 知道意思,但是有时候要很清晰地向同学介绍则有点转不过弯来。 召回率和准确率是数据挖掘中预测、互联网中的搜索引擎等经常涉及的两个概念和指标。 召回率:Reca...

atec3940的博客 230

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

Recall And Precision

precision和recall的计算公式总是忘记 这篇博客用来记录下 precision 是针对预测结果的 precision = TP / (TP + FP) recall 是针对原样本的 recall = TP / (TP + FN) 图示为: ...

xiaoxu1025的专栏 502

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

precision,recall and precision-recall curve

precision是指检索出中相关的比例,所以precision=true positive /(true positive+false negative). recall是指相关中被检索出的比例,所以recall= true positive/(true positive + false positive)。实际应用中往往precision和recall成反比关系。比如只检索出1条且相关,则pr

tangzy_的博客 6558

Recall, Precision, and Average Precision

信息检索(IR)的评价指标介绍 - 准确率、召回率、F1、mAP、ROC、AUC 分类: 1.自然语言处理/机器学习 在信息检索、分类体系中,有一系列的指标,搞清楚这些指标对于评价检索和分类性能非常重要,因此最近根据网友的博客做了一个汇总。 准确率、召回率、F1 信息检索、分类、识别、翻译等领域两个最基本指标是召回率(Recall Rate)和准确率(Precisio

三少GG 1万+

Precision、Recall and Mean Average Precision(MAP)

基本概念 Precision准确度 Recall召回率 Precision-Recall 曲线 MAP Reference论文 [1] 介绍了一种用于形状分类的metric,理论部分作者给出几组shape inference 的例子说明该metric的完备性。在实际应用部分,作者将该metric用到了植物种类的检测中。该应用涉及几个评价指标:Precision, Recall and Mean Av

HIT_ChenPeng的博客 4127

基础学习笔记——Recall, Precision, and Average Precision

以下内容绝大部分内容翻译自: Mu Zhu , Recall, Precision, and Average Precision. Working Paper 2004-09 Department of Statistics & Actuarial Science University of Waterloo.   1. 先介绍一些基础内容和符号说明   C:一个很大item的集合。

MinnieWW的专栏 8594

Precision, Recall, BLEU and ROUGE

NLP生成式的评价标准

weixin_42961017的博客 634

Precision, Recall and F-measure

Precision 和Recall是信息检索领域的常用评价指标。就直观意义而言,前者强调检索的精度,也即在所有检测到的结果中有多少是真正相关的;后者则强调检索的完整性,也成为查全率,关注在所有的相关记录中能够被检索到的比例,两者互为补充。 首先区别如下的关系:   相关 不相关 找到 A B 未找到 C D 则使用公式可以表

Moon_flower的博客 569

precision and recall rate

这俩概念的理解源自baidu。 (1)召回率 Recall rate,也叫查全率 检索出的相关文档数和文档库中所有的相关文档数的比例。衡量的是检索的查全率。 (2)精度 Precision 检索出的相关文档数与检索出的所有文档总数的比率。衡量的是检索系统的查准率。 例子:数据库中总共有记录500条,其中应有50条符合查询要求,但是查出了75条,其中真正符合查询要求的为45条。 那么召回

Always On The Way 1941
上一篇: 准确率(Precision)、召回率(Recall)以及综合评价指标(F1-Measure )
下一篇: Android(安卓)开发通过NDK调用JNI,使用opencv做本地c++代码开发配置方法 边缘检测 范例代码
watkins
博客等级 码龄18年 1277粉丝 246原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值