DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations

Accuracy, Precision, and Recall

A mathematician and developer discusses some concepts from the field of statistics that data scientists will find interesting.

John Cook user avatar by
John Cook
·
Sep. 10, 18 · Tutorial
Like (3)
Save
Tweet
Share
6.67K Views

Join the DZone community and get the full member experience.

Join For Free

I posted the definitions of accuracy, precision, and recall on @BasicStatistics recently. I think the tweet was popular because people find these terms hard to remember and they liked a succinct cheat sheet.

Accuracy = (TP+TN)/(TP+FP+FN+TN)
Precision = TP/(TP+FP)
Recall = TP/(TP+FN)

where

T = true
F = false
P = positive
N = negative

- Basic Statistics (@BasicStatistics) September 6, 2018

There seems to be no end of related definitions, and multiple names for the same definitions.

Precision is also known as positive predictive value (PPV) and recall is also known as sensitivity, hit rate, and true positive rate (TPR).

Not mentioned in the tweet above are specificity (a.k.a. selectivity and true negative rate or TNR), negative predictive value (NPV), miss rate (a.k.a. false negative rate or FNR), fall-out (a.k.a. false positive rate or FPR), false discovery rate (FDR), and false omission rate (FOR).

How many terms are possible? There are four basic ingredients: TP, FP, TN, and FN. So if each term may or may not be included in a sum in the numerator and denominator, that's 16 possible numerators and 16 denominators, for a total of 256 possible terms to remember. Some of these are redundant, such as one (a.k.a. ONE), given by TP/TP, FP/FP, etc. If we insist that the numerator and denominator be different, that eliminates 16 possibilities, and we're down to a more manageable 240 definitions. And if we rule out terms that are the reciprocals of other terms, we're down to only 120 definitions to memorize.

But wait! We've assumed every term occurs with a coefficient of either 0 or 1. But the F1 score has a couple coefficients of 2:

F 1 = 2TP / (2TP + FP + FN)

If we allow coefficients of 0, 1, or 2, and rule out redundancies and reciprocals...

This has been something of a joke. Accuracy, precision, and recall are useful terms, though I think positive predictive value and true positive rate are easier to remember than precision and recall respectively. But the proliferation of terms is ridiculous. I honestly wonder how many terms for similar ideas are in use somewhere. I imagine there are scores of possibilities, each with some subdiscipline that thinks it is very important, and few people use more than three or four of the possible terms.

Here are the terms I've collected so far. If you know of other terms or other names for the same terms, please leave a comment and we'll see how long this table goes.

|-----------------------------------+---------------------------------|
| Name                              | Definition                      |
|-----------------------------------+---------------------------------|
| Accuracy                          | (TP + TN) / (FP + TP + FN + TN) |
| True positive rate (TPR)          | TP / (TP + FN)                  |
| Sensitivity                       | see TPR                         |
| Recall                            | see TPR                         |
| Hit rate                          | see TPR                         |
| Probability of detection          | see TPR                         |
| True negative rate (TNR)          | TN / (TN + FP)                  |
| Specificity                       | see TNR                         |
| Selectivity                       | see TNR                         |
| Positive predictive value (PPV)   | TP / (TP + FP)                  |
| Precision                         | see PPV                         |
| Negative predictive value (NPV)   | TN / (TN + FN)                  |
| False negative rate (FNR)         | FN / (FN + TP)                  |
| Miss rate                         | see FNR                         |
| False positive rate (FPR)         | FP / (FP + TN)                  |
| Fall out                          | see FPR                         |
| False discovery rate (FDR)        | FP / (FP + TP)                  |
| False omission rate (FOR)         | FN / (FN + TN)                  |
| F1 score                          | 2TP / (2TP + FP + FN)           |
| F-score                           | see F1 score                    |
| F-measure                         | see F1 score                    |
| Sørensen-Dice coefficient         | see F1 score                    |
| Dice similarity coefficient (DSC) | see F1 score                    |
|-----------------------------------+---------------------------------|
Precision (computer science)

Published at DZone with permission of John Cook, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Microservices Testing
  • A Gentle Introduction to Kubernetes
  • DeveloperWeek 2023: The Enterprise Community Sharing Security Best Practices
  • 10 Most Popular Frameworks for Building RESTful APIs

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: