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

Probabilistic Classification

Framing classification as estimating P(y=1|x) and using probability thresholds to make discrete predictions.

Probabilistic Classification

What You'll Learn

You'll learn how classification models output probabilities rather than hard labels, and how you convert those probabilities into final predictions using thresholds.

The Core Idea

Unlike regression which predicts a continuous number, classification predicts categories. But here's the elegant twist: most classification models don't directly predict "cat" or "dog"—they predict the probability that something belongs to each class.

In binary classification, your model estimates P(y=1|x), which reads as "the probability that the output is class 1, given the input features x." For example:

  • Email spam classifier: P(spam|email content) = 0.85 → 85% chance this is spam
  • Medical diagnosis: P(disease|symptoms) = 0.12 → 12% chance of disease
  • Loan approval: P(default|applicant data) = 0.03 → 3% chance of default

From Probabilities to Predictions

Your model outputs a probability between 0 and 1, but you need a discrete decision. Enter the probability threshold (usually 0.5):

  • If P(y=1|x) ≥ 0.5 → predict class 1
  • If P(y=1|x) < 0.5 → predict class 0

Why this matters: The threshold isn't sacred! In medical screening, you might use 0.3 (catch more cases, accept false alarms). For fraud detection with high investigation costs, maybe 0.8 (only flag very suspicious cases).

Analogy

Think of a weather forecast: "70% chance of rain" is the probability. You decide the threshold—maybe you grab an umbrella at 30% because you hate getting wet, while your friend waits until 60%.

Key Takeaway: Probabilistic classification frames the problem as estimating P(y=1|x), giving you a confidence score that you convert to a final class prediction using an adjustable probability threshold.