Topic 22

Clustering

Concept

A week after marketing's question, the data team comes back with an answer nobody wrote: five piles. Late-night regulars. Office lunchers. Weekend families. Deal-hunters. One-and-done tourists. No one at Plateful invented those groups, and no label column named them — they were in the customer table all along, waiting for someone to look. Iris is looking at her first clustering result.

Clustering is the flagship unsupervised task: given rows with no labels, find the natural groups of similar rows. It's the machine version of last topic's photo-archive sorting — done on customers instead of photos, at a scale no human could manage. This page shows how similarity becomes piles, who turns piles into meaning, and the judgment calls hiding inside a result that looks so effortless.

Five neighborhoods in the customer table — found by the machine, named by humans
Plateful customers, plotted by behavior — hours, spend, frequency
Late-night regularsorders 11 p.m.–2 a.m. · frequent
Office lunchersweekdays at noon · work addresses
Weekend familiesbig weekend orders · home
Deal-huntersorder mostly with coupons
One-and-done touristsone order · never returned
The method drew the neighborhoods and called them group 1 through group 5. Every name above is a human reading of who landed together.

Similarity Is the Engine

How does a computer find groups without being told what to look for? By measuring similarity. Picture each customer row as a dot on a chart, positioned by its feature values — usual order hour along one direction, monthly spend along another, order frequency along a third. Customers with close values land near each other; customers with different habits land far apart. A cluster is a neighborhood on that chart: a bunch of dots that sit near one another and away from everyone else.

That's the whole engine. The clustering method looks for neighborhoods — dots that are mutually near — and assigns each row to one. This is the simplified picture: real methods differ in how they define "near" and how they search, and those internals are beyond this book. But the geometric intuition is the honest core, and it's all you need to reason about any clustering result you'll ever be shown.

The Machine Finds Piles — Humans Name Them

Here is what the method actually returns: "group 1: these 214,000 customers; group 2: these 90,000…" — memberships and nothing more. It does not return "office lunchers". Someone on the data team looked inside pile 2, saw weekday noon orders going to business addresses, and read a meaning into the pattern. That reading is not a garnish on the analysis. It is the analysis — the step that turns a pile of rows into something a company can act on.

Think of seating at a wedding reception with no seating plan. Nobody hands the guests categories, yet conversation circles form on their own — and only afterwards does the bride's mother glance over and say, "ah, that table is the university friends." The mingling made the groups; a human made the names. That's the division of labor in every clustering project: guests cluster by themselves, meaning arrives with the observer. Keep the two steps separate in your head, because only one of them is automatic.

How Many Piles? A Dial, Not a Truth

One thing may surprise you: with most clustering methods, a human chooses how many groups to ask for. Ask Plateful's table for 3 and you get coarse piles — roughly "weekday people, weekend people, one-timers". Ask for 20 and you get fragments — "late-night sushi lovers who tip well" — too many to build a strategy around. Neither answer is wrong, because the table holds no secret true number waiting to be discovered.

This is last topic's catch — no answer key — felt concretely. The team asked for five because five turned out to be useful: distinct enough to describe, few enough to act on. Usefulness, not correctness, sets the dial. When you see a neat "our seven customer segments" slide, remember someone chose seven, and choosing well is judgment, not arithmetic.

What Plateful Does with the Piles

Segments earn their keep when decisions attach to them. The late-night regulars get a midnight dessert promotion; office lunchers see group-order buttons at 11:40 on weekdays; deal-hunters get the coupon everyone else doesn't need; nobody wastes a marketing budget chasing the one-and-done tourists. Same app, different treatment per group — that's what "segmentation" means in every marketing meeting you'll ever sit in.

Clusters also feed the models that come later. Once every customer carries a segment, that segment becomes a feature — and Chapter 7's churn model will lean on it, because "weekend family going quiet" and "deal-hunter going quiet" turn out to mean different things. One honest boundary to hold on to: clustering describes the customers Plateful already has. It doesn't predict what anyone will do next — turning segments into predictions is a follow-up step, and usually a supervised one.

Common Confusions
  • "The algorithm knows what the groups mean." It only finds who-is-near-whom. "Office lunchers" is a human reading of pile 2 — the machine returned memberships and a number.
  • "There's one correct number of clusters." The table holds no secret true count. Three piles serve one decision, twenty serve another; usefulness sets the dial, and a human turns it.
  • "Clustering predicts what a customer will do." It describes the structure of existing behavior. Turning segments into predictions — who will churn, who will buy — is a separate, usually supervised, step.
Why It Matters
  • "Segment" is the most-used word in marketing analytics, and it now has visible machinery under it: similarity, neighborhoods, and a human doing the naming.
  • You can brief a clustering request properly — say what similarity should mean (hours? spend? dishes?) and what decision the piles will feed. Those two answers are most of a good brief.

Knowledge Check

How does clustering find groups without any labels?

  • It secretly uses a hidden label column that the team didn't notice
  • It measures similarity — close feature values form neighborhoods
  • It asks the marketing team which customers belong together
  • It assigns customers to groups at random and keeps the best-looking split

The clustering method labels a pile "group 2". Who decides that group 2 means "office lunchers"?

  • The algorithm — naming the groups is part of what it computes
  • The customers, when they pick a category in the app
  • A human, by looking at who landed in the pile and reading the pattern
  • The label column, which stores each customer's true segment

The team could ask for 3 clusters or for 20. Which is correct?

  • Whichever number matches the true group count hidden in the data
  • 20, because more clusters always capture the customers more accurately
  • 3, because fewer clusters means fewer chances to be wrong
  • Neither — the useful number depends on the decision it feeds

What can Plateful's five segments do on their own — and what can't they?

  • Describe how customers behave — but not predict future actions
  • Predict which customers will churn next month
  • Explain why each customer behaves the way they do
  • Keep themselves up to date as customer behavior changes

You got correct