Classification
The fake-review problem finally lands on a sprint board. Plateful's trust team wants every incoming review sorted: genuine or fake. Restaurant owners have been praising themselves under invented names; rivals have been trashing each other. Notice the shape of the answer the team wants. It is not a number of minutes — it is a kind. Genuine, or fake. One of two.
Prediction problems where the model picks a category are called classification, and once you see the shape you find it everywhere: spam or not, fraud or clean, "is this photo a pizza", "will this customer leave next month". This page names the parts of a classifier — and locates the one dial inside it that belongs to people like Iris at least as much as to the data team.
Classes — the Fixed Menu of Answers
The possible answers are fixed before training starts, and they are called classes. The fake-review model has two: genuine and fake. A dish-photo model might have hundreds: pizza, pad thai, ramen, salad, and on down the menu. Two classes or two thousand, the idea is identical — the model must pick from the menu, and it cannot answer anything that isn't on it. Ask the review model about a review in a language it never saw, and it will still answer "genuine" or "fake", because those are the only words it has.
The training labels are these same classes, written into the table the way Topic 16 described: people read thousands of reviews and marked each one — paid supervision, since no log records fakeness on its own. From those marked examples the model learns which feature patterns travel with which class: the burst of five-star reviews from day-old accounts, the phrasing that repeats across "different" customers.
What the Model Really Outputs
Here is the part that surprises most newcomers: the model usually does not output a verdict. It outputs a probability for each class — "fake: 0.87" — a score saying how strongly this review resembles the fake ones from training. The verdict comes later, from a separate step: a cutoff line called the threshold. Score above the line, the review is treated as fake; below, it passes.
An airport security officer works exactly this way. The scanner does not sort bags into "innocent" and "guilty" — every bag gets a level of suspicion, and the airport has decided in advance how suspicious is suspicious enough to open the bag. The suspicion level is the model's probability; the open-it line is the threshold. That is the whole shape of it: a classifier scores, and a threshold turns the score into a decision.
Who Sets the Threshold?
Not the model — people do, and where they set it is a trade. Put the line at 0.5 and the system flags eagerly: more fakes caught, but more honest reviews flagged too, and soon genuinely happy restaurant owners are writing angry emails about their vanished five-star reviews. Put the line at 0.9 and flags become rare and reliable — but more fakes slip through underneath. Moving the dial never removes errors; it only trades one kind for the other.
Which trade is right depends on what each mistake costs the product — the cost of an insulted honest reviewer against the cost of a surviving fake — and that is a product judgment, not a mathematical one. Iris's team owns this dial as much as the data team does. Chapter 6 builds the measuring tools — precision and recall — that show exactly what a given threshold trades away; for now it is enough to know the dial exists, and that someone on the product side should be holding it deliberately.
One Shape, Everywhere
Fake reviews are only the first classifier this book will meet. Fraud detection returns in Chapter 6, where it exposes how a score can lie. Churn prediction — will this customer leave? — anchors Chapter 7's end-to-end story. Dish-photo recognition waits in Chapter 8. And the spam filter from Topic 03 has been a classifier all along, scoring every email and cutting at a threshold you never see.
That gives you a working reflex for meetings. When a feature idea comes up, ask: is the wanted answer one of a fixed set of kinds? If yes, it is classification — and you already know its anatomy: classes on a menu, a probability per class, and a threshold that somebody must choose on purpose.
- "The model decides yes or no." It scores likelihoods. The yes/no line — the threshold — is chosen by people, based on what each kind of mistake costs the product.
- "Classification means two classes." Two is just the most common case. Any fixed menu of kinds works — photo models routinely pick among thousands of classes.
- "A probability of 0.87 means the model is right 87% of the time." It is the model's confidence about this case — how strongly it resembles training patterns — not the model's overall report card. Related, but not the same thing (Chapter 6 untangles scoring properly).
- "Setting a stricter threshold makes the model more accurate." It makes flags rarer and more reliable while letting more fakes slip through — a trade, not an improvement. No threshold setting removes both kinds of error.
- Probability plus threshold is the actual interface between a model and a product decision — the exact spot where a non-engineer's judgment enters the system.
- Half the ML features you will ever scope are classification; you can now name their parts and ask the right first questions about each one.
- "Who owns the threshold?" is a question most teams forget to ask out loud — asking it makes error trades deliberate instead of accidental.
Knowledge Check
Which of these is a classification problem?
- Predicting how many minutes a delivery will take
- Deciding whether a card transaction is fraud or clean
- Estimating how much a given customer will spend this month
- Forecasting Friday's total number of orders
The fake-review model processes a new review. What does it actually produce?
- A final verdict: the review is deleted or approved
- A probability for each class, like "fake: 0.87"
- A written explanation of why the review looks suspicious
- A corrected version of the review with fake parts removed
The trust team moves the flagging threshold from 0.5 up to 0.9. What happens?
- The model gets retrained to be more accurate
- More honest reviews get flagged, and somehow more fakes get caught too
- Both kinds of mistake become rarer at the same time
- Flags become rarer and more reliable, but more fakes slip through
Why is the threshold called a product decision rather than a data-team decision?
- Choosing it means weighing what each mistake costs the product
- The data team doesn't know what a threshold is
- The threshold barely affects anything, so anyone can set it
- Legal regulations require product managers to set all thresholds
You got correct