BuildSeniorData / MLAuto-graded
Catch duplicate customer records that aren't exact matches
Defining close enough defensibly, and still leaving every customer record in exactly one group, is the challenge.The customer-records deduper is supposed to collapse the same person or company, typed a dozen different ways, into a single record. In production it does not:Jon Smith, jon smith and Jon Smith! survive as three customers, a config meant to loosen matching actually tightened it, and in one postmortem a single record turned up inside two merged groups at once. Fix dedup(records, threshold) so near-duplicates merge, genuinely distinct records stay apart, and every record lands in exactly one group.45 min
python
You're done when
- The result is a clean partition — every record appears in exactly one group, never two.
- Case, punctuation and spacing variants of the same name merge together.
- Accented spellings and small typos merge with their plain counterparts.
- Records linked through an intermediate variant end up in one cluster rather than several.
- Pairs scoring below the threshold stay separate, so the threshold actually loosens matching as it falls.
- Genuinely distinct records remain on their own.
- The clustering matches the expected grouping on the reference dataset.
What it measures
Data qualityJudging when two messy records describe the same real entity, and when merging them would destroy information.
Data preparation and preprocessingNormalising case, punctuation and accents before comparison, so similarity is measured on comparable text.
Data structures and algorithmsBuilding transitive clusters that remain a strict partition, which is where the double-membership bug comes from.
Your environment
Terminal + editorA full shell in the browser
Claude CodePre-authenticated, no key setup
Isolated microVMYours alone, wiped afterwards
Start this lab
45 min
Start labYou'll sign in to Anthropos to start. The lab opens in a private cloud workspace with Claude Code ready to use.AI Labs is part of Anthropos Workforce. Not on your plan yet? Book a demo