Skip to main content
Crowdfunding
Python + AI for Geeks
Practice

Evaluating Model Prediction Performance - Precision

In machine learning, when evaluating the performance of a classification model, Precision is as crucial a metric as accuracy.

Precision is calculated as follows:

Precision=TPTP+FP\text{Precision} = \frac{TP}{TP + FP}

The terms are defined as follows:

  • TP (True Positive): Actual positive cases that the model correctly predicted as positive

  • FP (False Positive): Actual negative cases that the model incorrectly predicted as positive

In simpler terms, precision is the proportion of predicted positive cases that are actually positive.


Understanding Precision

High precision indicates that the model's positive predictions are reliable.

For example, in a cancer diagnosis model with high precision, a patient predicted to have cancer is likely to truly have cancer.

However, high precision does not necessarily mean the model is perfect.

By reducing the number of predicted positive cases, precision can be artificially increased, sometimes at the cost of missing genuine positive cases.

For instance, if a machine learning model only predicts positives when it is absolutely certain and categorizes all uncertain cases as negative, it might achieve high precision but miss many true positives.


When Precision Matters

Precision is particularly crucial in the following scenarios:

1. Disease Diagnosis Systems (Cancer Diagnosis Models)

In models diagnosing cancer, high precision means that individuals predicted to have cancer are indeed more likely to have the disease.

If precision is low, non-cancerous individuals might be incorrectly labeled as having cancer, leading to unnecessary medical procedures.

2. Spam Filtering Systems

In spam filters, high precision indicates that the emails categorized as spam are mostly actual spam.

If precision is low, important emails might be misclassified as spam, posing a risk of missing essential communications.

3. Fraud Detection Systems

In financial transactions, a model with high precision in fraud detection suggests that transactions predicted as fraudulent are likely to be genuine frauds.

Low precision might result in normal transactions being misclassified as fraudulent, causing inconvenience to users.


Limitations of Precision

A model with high precision isn't always ideal.

Excessively high precision can lead to a decrease in Recall, posing additional problems.

This means that the model might miss instances of actual positives due to cautious predictions.

For example, in spam filters, only blocking definite spam to boost precision might allow dubious spam emails to pass through as legitimate messages.

Hence, in real-world model evaluations, both precision and recall should be considered.

In the next class, we will explore Recall, which complements the limitations of precision.

Want to learn more?

Join CodeFriends Plus membership or enroll in a course to start your journey.