Course contentsShow
← Machine Learning and Deep Learning
Lesson 243 of 3,5384. Classification with Logistic RegressionFree lesson

Classification Metrics Preview

Brief overview of accuracy, precision, recall, and why accuracy alone is often insufficient for classification.

Classification Metrics Preview

What you'll learn: Why measuring classification model performance requires more than just counting correct predictions.

Beyond Simple Accuracy

When you built regression models, you used metrics like MSE or R² to measure performance. For classification, the most intuitive metric is accuracy—the percentage of predictions your model gets right. If your model correctly classifies 90 out of 100 emails as spam or not spam, that's 90% accuracy.

Sounds great, right? Not always.

Why Accuracy Can Mislead

Imagine a medical test for a rare disease that affects only 1% of the population. A lazy model that always predicts "no disease" would achieve 99% accuracy—yet it would miss every single sick patient! This is where accuracy fails us.

The Core Metrics Family

To properly evaluate classifiers, you need four key metrics:

Accuracy: Overall correctness—what fraction of all predictions were right?

Precision: Of all the cases you predicted as positive, how many were actually positive? (Quality of positive predictions)

Recall: Of all the actual positive cases, how many did you successfully identify? (Completeness of detection)

These metrics reveal different aspects of your model's behavior. A spam filter with high precision rarely marks real emails as spam (few false alarms), while high recall means it catches most actual spam (few missed threats). You often face a tradeoff between them.

The Real-World Impact

In cancer detection, you want high recall (catch every case). In email spam filtering, high precision matters more (don't lose important emails). Accuracy alone can't capture these nuanced requirements.

Key Takeaway: Accuracy tells you overall correctness, but precision and recall reveal how your model handles each class—critical information when errors have different costs or when classes are imbalanced.