Classification: choosing categories
Sorting messages into categories is not a sure-thing guess. Many spam filters rate each email with a number first, then use a cutoff rule to pick the final category.
Why many classifiers start with a score.
In Lesson 4.2, regression estimated a number such as a price. Classification is supervised learning that chooses a category (also called a class) from a fixed set of options, such as sorting an email into Spam or Inbox.
In this lesson, you will follow six terms in order: classification, category, score, threshold (cutoff), false alarm, and missed spam.
A common misconception is that a classifier “knows” the true category. While some classifiers output a label directly, many first compute a numeric score—for example, on a scale from 0.00 to 1.00, where a higher score means this filter rates the email as more spam-like based on clues it learned from labeled examples.
Even when a score looks like a percentage, a raw score of 0.66 is not automatically a 66% real-world chance of spam. Checking whether scores match real-world chances is a separate calibration step you will see in Chapter 5.
Next, a separate threshold (or cutoff) number turns that score into a label using a decision rule. In this lesson, the rule is: if an email’s score is at or above the cutoff (including an exact tie), the filter flags it as Spam; if the score is below the cutoff, the filter keeps it in Inbox.
Think of a smoke detector: its sensor measures smoke level first, and an alarm trigger level decides whether to beep. The analogy has a limit—a smoke detector measures physical smoke, whereas a spam filter only scores text clues learned from past examples.
Sam (an invented shop owner for this lesson) receives six emails with illustrative spam scores. To see when the filter makes a mistake, we compare the filter’s decision (Inbox or Spam) against Sam’s own judgment—called the reference label (Wanted or Spam).

How a cutoff turns a score into a category.
Because the model does not know Sam’s true intent, a cutoff can produce two kinds of mistakes:
- False alarm: a
Wantedemail scores at or above the cutoff and gets flagged asSpam. - Missed spam: a
Spamemail scores below the cutoff and slips intoInbox.
Look at what happens on Sam’s six invented emails when we apply the same fixed scores at two different cutoffs. Two borderline emails explain why mistakes happen: Sam signed up for the publisher’s 0.66 flash-sale offer (so Sam labels it Wanted), while the calm 0.52 website-listing message is an unsolicited sales pitch Sam considers Spam.
At cutoff 0.50
Four emails score 0.50 or higher (0.94, 0.80, 0.66, 0.52) and are flagged as Spam. Two emails (0.26, 0.10) stay in Inbox.
Result: 1 false alarm (the 0.66 publisher promo) and 0 missed spam.
At cutoff 0.75
Only two emails score 0.75 or higher (0.94, 0.80) and are flagged as Spam. Four emails (0.66, 0.52, 0.26, 0.10) stay in Inbox.
Result: 0 false alarms, and 1 missed spam (the 0.52 unsolicited sales pitch).
Notice why no single cutoff can get all six right: the wanted 0.66 publisher promo scored higher than the 0.52 spam pitch. Because those scores overlap, people choose the cutoff based on which mistake hurts less—not because one number is magic.
Outside email, an airport metal detector works the same way when screening for prohibited items. Turning sensitivity higher catches more metal objects, but everyday belt buckles and keys trigger more false alarms.
Moving the cutoff trades one mistake for another.
On a fixed set of scores, moving the cutoff moves the boundary line without changing any email’s score:
- Lowering the cutoff flags the same or more emails as
Spam. Missed spam stays the same or drops, while false alarms stay the same or rise. - Raising the cutoff flags the same or fewer emails as
Spam. False alarms stay the same or drop, while missed spam stays the same or rises.
A count can stay flat when no email scores at or above the lower cutoff and below the higher cutoff. For example, on Sam’s six emails, moving from 0.50 to 0.60 leaves false alarms at 1, because the 0.66 promo is still at or above both cutoffs.
Different jobs call for different cutoffs. Sam prefers a higher cutoff like 0.75 so real customer orders and publisher offers are not buried in Spam, accepting an occasional spam email in the inbox. By contrast, a bank fraud alert may use a lower cutoff so suspicious charges are flagged for a human check.

Try it: move the spam cutoff on Sam’s inbox.
Every email’s score stays fixed while you drag the slider. Watch how the vertical cutoff line crosses each score bar and flips the filter’s decision.
- Start at Default (0.50) and find the
0.66publisher promo marked False alarm. - Click Flag less (0.75) and notice that false alarms drop to 0 while the
0.52sales pitch becomes Missed spam. - Click Flag more (0.20) and see how flagging more emails catches all spam but causes 2 false alarms (the
0.66publisher promo and the0.26customer question). - Drag the slider across
0.50to0.70and watch the0.66wanted promo and0.52spam pitch show why no cutoff gets zero mistakes, then click Reset to 0.50.
Sam’s bookstore spam cutoff
Cutoff 0.50 catches all 3 spam emails, but causes 1 false alarm on wanted mail.
- “Win a FREE cruise today!!!”Score 0.94
Mass giveaway scam.
Sam’s label: SpamFilter: SpamMatch - “Urgent: verify your bank password now”Score 0.80
Fake bank message trying to steal a password.
Sam’s label: SpamFilter: SpamMatch - “FLASH SALE: 30% off mystery novels this weekend”Score 0.66
Real publisher offer Sam signed up for.
Sam’s label: WantedFilter: SpamFalse alarm - “Quick question about your website listing”Score 0.52
Unsolicited sales pitch Sam considers spam.
Sam’s label: SpamFilter: SpamMatch - “Can you hold 2 copies of the new cookbook?”Score 0.26
Customer order question.
Sam’s label: WantedFilter: InboxMatch - “Invoice #412 for Tuesday's book delivery”Score 0.10
Regular supplier invoice.
Sam’s label: WantedFilter: InboxMatch
Illustrative example: these six emails and fixed spam scores are invented for this lesson so you can see how moving the cutoff changes decisions without changing the model.
What a score does—and does not—mean.
A high score means this filter rated the email as strongly spam-like based on clues learned from labeled examples—not that it checked the sender’s real intent. When real messages borrow spam-like words (“FLASH SALE”) or spam borrows polite wording, scores overlap and mistakes follow.
Classification also extends beyond two categories. A bookstore support classifier might score three categories—Order, Return, and General question—and typically pick the highest-scoring label, or route low-scoring messages to a person.
- Is 0.50 always the best cutoff?
No.
0.50is a common starting point, not a universal rule. Teams choose a cutoff based on which mistake costs more in their setting. - Does moving the cutoff retrain the model?
No. The model and its scores stay unchanged. Moving the cutoff only changes the decision rule applied to those scores.
- How is classification different from regression (Lesson 4.2)?
Regression estimates a continuous number, like a house price or temperature. Classification chooses a label from a fixed set of categories, often using scores and a decision rule.
Check your understanding.
Take this with you.
Many classifiers score first; a cutoff decides. A model does not know the true category—in score-based filters, it outputs a score and a separate cutoff rule turns that score into a label. Moving the cutoff on a fixed batch does not change the scores; it can only keep or trade false alarms against missed cases so you can match the decision to what matters most.
Ready to continue? Return to How Machines Learn.