What Precision Meaning, Applications & Example
A metric that measures the fraction of true positive predictions.
What is Precision?
Precision is a metric used to evaluate the performance of a classification model , specifically measuring the accuracy of positive predictions. It is defined as the ratio of true positive predictions (correctly predicted positive cases) to the total number of instances predicted as positive (the sum of true positives and false positives). Precision is particularly useful when the cost of false positives is high.
Precision Formula
\[ \text{Precision} = \frac{\text{True Positives}}{\text{True Positives} + \text{False Positives}} \]Where:
- True Positives (TP): The number of correct positive predictions.
- False Positives (FP): The number of incorrect positive predictions.
When to Use Precision
Precision is most useful when:
- The consequences of false positives are costly or undesirable. For example, in email spam detection, falsely marking a legitimate email as spam (false positive) could be problematic.
- The focus is on the reliability of positive predictions, such as in medical diagnosis, where a false positive might lead to unnecessary treatments.
Applications of Precision
- Medical Testing: In disease detection, precision helps to measure how many of the predicted positive cases (e.g., those who are diagnosed with a disease) are actually correct. High precision ensures that fewer healthy individuals are misclassified as sick.
- Email Spam Filters: Precision is used to evaluate how accurately spam filters classify unwanted emails. A high precision means fewer legitimate emails are marked as spam.
- Fraud Detection: In fraud detection systems, precision ensures that only a small number of legitimate transactions are incorrectly flagged as fraudulent.
Example of Precision
For a fraud detection system:
- If a model predicts 100 transactions as fraudulent, and 80 of them are indeed fraudulent (true positives), but 20 are actually legitimate (false positives), then the precision of the system is:
This means 80% of the flagged fraudulent transactions were correctly identified as fraudulent, which is an acceptable result in many fraud detection applications.