Page 8 of 8~112 min topic

Clustering

Ship and explain the two-cluster segmenter

Page 8 packages proved vs unproved evidence so another engineer can run, trust, or reject the two-cluster customer segmenter.

~14 min this pageMastery and shippingReviewed 2026-08-08

1Learn the idea

Read

Assemble the ship record

A shippable lab artifact includes: how to run it, the metric result (silhouette or inertia recorded; centers have finite values), the failure you can still reproduce (k larger than n, or scaling skipped so one feature dominates), the security gate for joining cluster IDs back to raw emails in an unsecured export, and a rollback note. The user decision it supports remains: group customers by spend/visits without pretending clusters are ground-truth labels.

Read

Freeze the evidence

report={'seed':7,'sizes':[3,3],'wcss':0.031,'interpretation':'low/high activity hypotheses'}
assert sum(report['sizes'])==6
print(report)

Expected evidence: stage evidence for mastery ship. Store this beside the fixture version so scores remain meaningful after content changes in clustering-basics.

Read

Explain limits without apology

State operating limits for the two-cluster segmenter in plain language: fixture size, offline vs live dependencies, and what would require a new eval set. Shipping clustering-basics is honest scoping, not maximal confidence language.

Read

Lab notebook: proved vs unproved

Fill this table in your notes for the two-cluster segmenter:

  • Proved on small 2D customer matrix: …
  • Unproved beyond the fixture: …
  • Metric that blocks release: silhouette or inertia recorded; centers have finite values
  • Failure still reproducible: k larger than n, or scaling skipped so one feature dominates
  • Security gate: joining cluster IDs back to raw emails in an unsecured export
  • Rollback: …

Ship the narrative only when the unproved list is honest. Reviewers trust narrow claims that support group customers by spend/visits without pretending clusters are ground-truth labels more than maximal language that collapses under the first production oddity.

Read

Worked judgment

Hand your ship note to a peer and ask them to recreate a proved/unproved ship note with rollback without watching you type. If they cannot, your evidence is still tribal knowledge. Tighten the run command and the metric line until a stranger can validate the two-cluster segmenter against small 2D customer matrix.

Read

Why this stage matters for the two-cluster segmenter

At the mastery and shipping stage for clustering-basics, the job is narrower than finishing a product demo. You are creating one progressive evidence piece about small 2D customer matrix that later pages inherit without redefining success. Keep that fixture small enough to inspect by hand, keep outputs copy-pasteable as text, and refuse to narrate this baseline as if it were a production SLA: random two-group assignment inertia for comparison.

For this page specifically, success looks like a proved/unproved ship note with rollback while still centering the user decision to group customers by spend/visits without pretending clusters are ground-truth labels. If you cannot point to a file, command, or assertion that proves that for the two-cluster segmenter, stay on this page instead of advancing.

Glossary: clustering · Cheatsheet: ML Python starter

Previous

Go deeper

Before you start

Why this matters

List two things this chapter proved on the fixture and two things it did not prove about the two-cluster segmenter. If you cannot name the gaps, you are not ready to ship the narrative—even if the code runs.

Check your understanding

Page assessment

Answer from memory. Completion is saved from this evidence, not from opening the next page.

1. Are proved and unproved lists both non-empty?
2. Is rollback concrete (command or version pin)?
3. Would a stranger reproduce the metric on the fixture?
4. Does the note still center the decision: group customers by spend/visits without pretending clusters are ground-truth labels?

All responses are required.