Kavita Ganesan 2024年11月26日
What are Precision & Recall in Machine Learning?
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

文章探讨了机器学习中精度和召回率的概念及计算方法。通过邮件垃圾邮件预测的例子进行说明,解释了精度衡量正确阳性预测的比例,召回率衡量模型正确识别的实际阳性标签的比例,强调二者需平衡,且其可接受程度取决于应用。

📌精度衡量正确阳性预测的比例,如文中例子精度为50%。

📌召回率衡量模型正确识别的实际阳性标签的比例,文中例子召回率为33%。

📌精度强调正确性,召回率强调覆盖性,二者需平衡。

📌模型的好坏取决于精度和召回率是否在可接受水平。

Precision and recall are commonly used metrics to measure the performance of machine learning models or AI solutions in general. It helps understand how well models are making predictions.

Let’s use an email SPAM prediction example. Say you have a model that looks at an email and decides whether it’s SPAM or NOT SPAM. To see how well it’s doing, you want to compare it with human-generated labels, which we will call the actual labels.

To demonstrate this, the table below shows you some actual labels and the machine (model) predicted labels. Now we’ll assume that the spam prediction is positive, and the not spam prediction is negative.

Email IDActual LabelMachine Predicted Label
Email 1Spam (positive)Spam (positive & correct)
Email 2Spam (positive)Not Spam (negative & incorrect)
Email 3Not Spam (negative)Spam (positive & incorrect)
Email 4Spam (positive)Not Spam (negative & incorrect)
Email spam predictions with corresponding true predictions.

What is Precision in ML?

Given this, intuitively, precision measures the proportion of correct positive predictions.

How precision is computed

As you can see from the table above, out of the 2 spam (positive) machine predictions, only 1 is correct. So the precision is 0.5 or 50%.

What is Recall in ML?

Recall measures the proportion of actual positive labels correctly identified by the model.

How recall is computed

From the table above, notice that we have 3 actual labels that are positive, and out of that only one is correctly captured by the model. So the recall is 0.33 or 33%.

All in all, in the SPAM prediction example, precision is 50% and recall is 33%.

What Message Do Precision and Recall Convey?

What precision measures at a high level is correctness. What recall measures at a high level is coverage. For example, if precision is 98% it means that when the model says the prediction is positive, the prediction is likely accurate. A model can be overly conservative and only make limited positive predictions, resulting in high precision. In other words, it fails to make sufficient positive predictions. This is why you also need to consider recall—to ensure you’re capturing sufficient actual positives.

When it comes to recall, a high recall means that the model can capture most of the positive predictions. But if a model says everything is positive regardless of underlying reasoning, the recall will be artificially high and close to perfect. That’s why you need to balance between precision and recall. You want accurate predictions, but at the same time not at the cost of missing out on too many positive predictions (false negative predictions). Ideally, you want sufficiently high precision and recall.

Summary

In summary, precision measures the proportion of correct positive predictions, and recall measures the coverage of actual positive labels. For a model to be considered “good” both precision and recall must be at acceptable levels. In the end, what’s acceptable depends on the application.

Keep Learning & Succeed With AI

    Join my AI Integrated newsletterwhich clears the AI confusion and teaches you how to successfully integrate AI to achieve profitability and growth in your business.Read  The Business Case for AI to learn applications, strategies, and best practices to be successful with AI (select companies using the book: government agencies, automakers like Mercedes Benz, beverage makers, and e-commerce companies such as Flipkart).Work directly with me to improve AI understanding in your organization, accelerate AI strategy development and get meaningful outcomes from every AI initiative.

Recommended Reading:

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

机器学习 精度 召回率 平衡
相关文章