Skip to content

Deduplicating Chicago's early childhood sites

Nine public lists of early childhood education sites in Chicago, from the city, the school district, the state and associations, describe the same places in different ways. Merged, they hold 3,337 rows for 1,162 real sites. This is the dataset of the official Dedupe example, with the true site of every row labelled by its authors.

Univo groups the rows in under a tenth of a second, without labelling, training or a model.

3,337
rows from 9 sources
889
groups of proposed duplicates
96%
of the pairs found are true duplicates, on sites held out from tuning
0.1 s
to group every row, on a laptop

The data

One site, as six of the sources list it:

Name Address Source
Ezzard Charles School 7946 S. Ashland Chicago Public Schools portal
Ezzard Charles 7946 South Ashland Illinois child care providers
CHICAGO YOUTH CENTERS EZZARD CHARLES SCHOOL 7946 S ASHLAND AVE City providers, 2011
Chicago Youth Centers Ezzard Charles School 7946 S Ashland Ave City agency sites, 2012
Ezzard Charles 7946 S Ashland Find a School
Ezzard Charles School 7946 South Ashland Avenue NAEYC accreditation

Case, abbreviations ("S." and "South", "Ave" and "Avenue") and the agency's name in front differ. The ZIP code is missing in 40% of the rows and the phone number in 4%.

The code

from univo import Exact, Finder, Schema, Text

schema = Schema(
    id_field="id",
    fields={
        "name": Text(),       # compared by spelling: typos, case, abbreviations
        "address": Text(),
        "phone": Exact(),     # compared only when both rows have one
        "zip": Exact(),
    },
)
groups = Finder(schema=schema).group(records, min_score=0.65)

Each group holds rows that all score 0.65 or more against each other. The complete example is 22 lines of code; the data was cleaned beforehand, phone numbers reduced to their last seven digits.

Merging every group would remove 1,875 rows; 2,175 rows duplicate a site. Univo never merges anything itself. A group is a proposal to review, because similarity is not identity: two branches of one agency can share a phone number.

Choosing the threshold without fooling yourself

A threshold tuned on the data it is measured on looks better than it will be on new data. The sites were split in two by a hash of their label:

  • on the validation half, three schemas and ten thresholds were tried, and the best recall with at least 95% precision was kept;
  • the test half was measured once, with those settings.
Test half (1,602 rows, 2,885 true pairs) Pairs found Precision Recall
Pairs scoring 0.65 or more (find) 2,174 96.2% 72.5%
Pairs inside groups (group) 1,959 97.7% 66.3%

Groups are a little more precise than pairs and find fewer: a row joins a group only if it matches every member.

Which fields to compare

Every field that identifies a site adds evidence. With the phone number and the ZIP code, recall at 95% precision rises from 69% to 77%.

Exact fields count only when both rows have a value, so a missing ZIP code is no evidence either way. To make a difference rule out a match, such as two different tax numbers, use Exact(conflict="reject") (scoring).

What it misses

  • Different phone numbers. Some sources list the agency's number, others the site's, sometimes one digit apart.
  • Program names. "Chicago State University Raise Up a Child" and "Chicago State University - Academy of Early Education" are one site at the same address, but their names and phone numbers differ.
  • Imperfect labels. Some pairs counted as wrong look like the same site, such as "El Hogar del Niño New Loomis" and "El Hogar Loomis" at 1718 S. Loomis with the same phone number. Precision may be a little higher than measured.

Run it

git clone https://github.com/leopoldch/univo-examples
cd univo-examples
pip install univo==1.0.1
python clean-a-csv/dedupe.py

The measurements of this page come from benchmarks/chicago in the Univo repository: python -I benchmarks/chicago/chicago_quality.py.

Measured with Univo 1.0.1 from PyPI, Python 3.14, Apple M2. The data is csv_example_input_with_true_ids.csv from dedupeio/dedupe-examples (MIT), pinned to a commit and checked by SHA-256.

Next: best practices.