Precision

Precision is the share of a model's positive predictions that are correct: of everything it flagged, how much really was what it claimed.

Precision answers one question: when the model said yes, how often was it right? Google's machine learning glossary gives the formula as true positives divided by true positives plus false positives. If a spam filter marks 200 emails as spam and 150 really are spam, its precision is 150 divided by 200, or 0.75. The other 50 were legitimate emails wrongly sent to the spam folder.

Precision matters most when false alarms are expensive. A fraud system that freezes accounts, a content filter that removes posts, or a tool that flags job applicants for rejection all need high precision, because every false positive lands on a real person. Google's crash course recommends precision when positive predictions need to be reliable.

Precision is always read alongside recall, which measures how many of the real positives the model found. The two pull against each other. Most classifiers output a score and call anything above a threshold positive. Raising the threshold makes the model more cautious, which usually raises precision and lowers recall; lowering it does the reverse. The F1 score combines the two into a single number.

The idea has spread beyond classifiers. Search and retrieval systems measure precision as the share of returned results that are relevant, and Google's glossary describes citation precision for language models: the share of an answer's citations that actually support its claims. In each case the question is the same: how much of what the system put forward was right?

Common questions

What is the difference between precision and recall?

Precision is the share of positive predictions that were correct. Recall is the share of actual positives the model found. A model that flags very little can have high precision but low recall; one that flags almost everything can have high recall but low precision.

How do you calculate precision?

Divide the number of true positives by the total number of positive predictions, which is true positives plus false positives. For example, 150 correct positives out of 200 positive predictions gives a precision of 0.75.

When should you prioritise precision over recall?

When a false positive is costlier than a missed case, for example wrongly blocking a customer's payment or removing legitimate content. Where missing a true case is worse, such as screening for a serious disease, recall usually matters more.

Finding more

Search for "precision and recall", "precision-recall curve" or "classification threshold". Course material from Google's Machine Learning Crash Course, documentation for libraries such as scikit-learn and statistics textbooks explain the formulas reliably. When a product claims high precision, check what threshold and test data were used and what recall came with it.

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.