🟪 1-Minute Summary

Accuracy is the proportion of correct predictions: (TP + TN) / Total. Simple and intuitive, but MISLEADING for imbalanced datasets. If 95% of emails are not spam, a model that always predicts “not spam” gets 95% accuracy but is useless. Use accuracy only for balanced datasets; prefer precision, recall, or F1 for imbalanced data.


🟦 Core Notes (Must-Know)

Formula

[Content to be filled in]

When to Use Accuracy

[Content to be filled in]

When NOT to Use Accuracy

[Content to be filled in]

The Imbalanced Data Problem

[Content to be filled in]


🟨 Interview Triggers (What Interviewers Actually Test)

Common Interview Questions

  1. “Your model has 95% accuracy. Is it good?”

    • [Answer: Need to know class distribution first!]
  2. “Why is accuracy misleading for imbalanced datasets?”

    • [Answer: Majority class dominates the metric]
  3. “What metric would you use instead of accuracy for fraud detection?”

    • [Answer: Recall or F1 - fraud is rare but important to catch]

🟥 Common Mistakes (Traps to Avoid)

Mistake 1: Using accuracy as the only metric

[Content to be filled in]

Mistake 2: Not checking class distribution first

[Content to be filled in]


🟩 Mini Example (Quick Application)

Scenario

[Imbalanced dataset accuracy trap]

Solution

from sklearn.metrics import accuracy_score

# Example showing why accuracy can be misleading


Navigation: