What is the difference between global and local recoding when achieving k-anonymity?
Global recoding generalizes every value in a column to the same level; local recoding lets different rows in the same column sit at different levels — preserving more utility.
Both produce valid k-anonymity; they differ in how uniformly they coarsen a quasi-identifier:
- Global recoding — pick one generalization level for the whole column. E.g. every ZIP becomes
80**. This is the cleanest "textbook" answer and matches Sweeney's original definition. - Local recoding — generalize only as much as each row needs. E.g. ZIPs
8001and8005collapse to800*, while8032stays at full precision. Modern algorithms like Mondrian and Datafly prefer this because it keeps more detail.
Worked example from the exercise: on a 10-row finance dataset, global recoding (ZIP → 80**, age → 5-year bins) gives two equivalence classes of size 5; local recoding (only 8001/8005 → 800*, 8032 kept) keeps the Oerlikon-vs-downtown-Zurich distinction that matters for regional fraud analysis.
Tip: Global = uniform, safer, more utility lost. Local = surgical, more utility kept, but a strict reading of Sweeney's k-anonymity rejects it. Choose deliberately, not by accident.
Go deeper:
k-anonymity (Wikipedia) — generalization strategies and Datafly/Mondrian-style recoding.
k-Anonymity (Sweeney, 2002) — the original global-recoding definition.