✅Model Evaluation Metrics (Accuracy, Precision, Recall) 📊🧠
When you build a classification model (like spam detection or disease prediction), you need to measure how good it is. These three basic metrics help:
1️⃣ Accuracy – Overall correctness
Formula: (Correct Predictions) / (Total Predictions)
➤ Tells how many total predictions the model got right.
Example:
Out of 100 emails, your model correctly predicted 90 (spam or not spam).
✅ Accuracy = 90 / 100 = 90%
Note: Accuracy works well when classes are balanced. But if 95% of emails are not spam, even a dumb model that says “not spam” for everything will get 95% accuracy — but it’s useless!
2️⃣ Precision – How precise your positive predictions are
Formula: True Positives / (True Positives + False Positives)
➤ Out of all predicted positives, how many were actually correct?
Example:
Model predicts 20 emails as spam. 15 are real spam, 5 are not.
✅ Precision = 15 / (15 + 5) = 75%
Useful when false positives are costly.
(E.g., flagging a non-spam email as spam may hide important messages.)
3️⃣ Recall – How many real positives you captured
Formula: True Positives / (True Positives + False Negatives)
➤ Out of all actual positives, how many did the model catch?
Example:
There are 25 real spam emails. Your model detects 15.
✅ Recall = 15 / (15 + 10) = 60%
Useful when missing a positive case is risky.
(E.g., missing cancer in medical diagnosis.)
🎯 Use Case Summary:
⦁ Use Precision when false positives hurt (e.g., fraud detection).
⦁ Use Recall when false negatives hurt (e.g., disease detection).
⦁ Use Accuracy only if your dataset is balanced.
🔥 Bonus: F1 Score balances Precision & Recall
F1 Score: 2 × (Precision × Recall) / (Precision + Recall)
Good when you want a trade-off between the two.
💬 Tap ❤️ for more!
Post #3859
5.58K
- ❤ 9
- 👏 2