Course contentsShow
← Computer Science
Lesson 2829 of 2,87263. Classical ML AlgorithmsFree lesson

Interpreting Probabilities and Decision Boundaries

Understand how logistic regression outputs probabilities and how to threshold them for classification.

Interpreting Probabilities and Decision Boundaries

What you'll learn: How logistic regression converts probabilities into binary predictions using decision boundaries.

The Core Idea

Logistic regression doesn't directly predict "yes" or "no"—it predicts the probability that an input belongs to the positive class. The sigmoid function outputs a value between 0 and 1, representing this probability. To make an actual classification decision, you need to choose a threshold (usually 0.5) and convert probabilities into discrete class labels.

Think of it like a weather forecast: the model says "70% chance of rain." You then decide whether to carry an umbrella based on your personal threshold—maybe you take one if there's >50% chance, but someone else might wait until 80%.

From Probabilities to Decisions

Given a logistic regression hypothesis that outputs P(y=1|x):

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

This threshold of 0.5 creates an invisible decision boundary in your feature space—a line (or surface in higher dimensions) that separates the two classes. Points on one side get labeled 1, points on the other get labeled 0.

Why Thresholds Matter

You can adjust this threshold based on your application's needs:

  • Lower threshold (e.g., 0.3): More sensitive, catches more positive cases but may include false positives
  • Higher threshold (e.g., 0.7): More conservative, reduces false positives but may miss true positives

For example, in medical diagnosis, you might use a lower threshold to avoid missing serious conditions, accepting more false alarms as a tradeoff.

Key Takeaway: Logistic regression outputs probabilities that you threshold to make binary decisions; the threshold defines a decision boundary that separates classes, and you can adjust it to balance different types of errors.