Skip to content

Focusing a metro

When you select a metro from the picker, LookAlike zooms the map to that metro and re-ranks neighborhoods to surface the best matches within that metro rather than across the entire country. This is useful when you are screening for expansion in a specific market rather than hunting nationally.

The metro focus also adds a screening rollup at the top of the neighborhood list — a quick count of how many neighborhoods in this metro reach the high-similarity threshold (85th percentile or above), and whether they are open markets or already contain a brand location.

Ranking metros against each other (Top metros)

Section titled “Ranking metros against each other (Top metros)”

Focusing a metro answers “which neighborhoods in this metro should I look at?” The Top metros view answers the prior question: “which metro should I look at first?” It is a sibling of the lookalikes list — open it from the list header, and return with the ”← LookAlikes” button.

Top metros ranks every metropolitan area by the count of open, high-resemblance-rank neighborhoods it holds — tracts at the 85th percentile or higher for the current brand and weights that do not already contain a store. Click any metro in the ranking to focus the map on it.

The picker offers 383 Metropolitan Statistical Areas (MSAs) based on the US Census CBSA delineation from 2023. These are the Census’s official metro-area definitions, spanning all of continental United States.

The data comes from fetch_cbsa.py, which maps the Census’s CBSA reference file to individual census tracts. A tract belongs to a metro if its county sits in that metro’s geographic footprint. Unincorporated rural areas and non-metro counties are assigned a metro code of zero (no metro).

Each census tract’s county FIPS code is cross-walked to its CBSA code using the Census’s official 2023 delineation file. The pipeline writes two assets:

  • web/public/data/metros.json — metadata for each of the 383 metros: the CBSA code, official name, tract count, bounding box, and center point (for map positioning).
  • web/public/data/tracts/cbsa.u16 — a binary uint16 array, one value per tract in the standard geoids order. A value of 0 means the tract is not in any metro; any other value is the CBSA code it belongs to.

Because the metro assignment is based on county-level delineation, all tracts in a county belong to the same metro or no metro. Tract boundary precision is limited by county boundaries.

When a metro is focused, the CandidatesList component displays a summary above the ranked neighborhoods:

[Metro Name]: X neighborhoods at the 85th percentile or higher · Y open · Z already with a store

This breaks down the metro’s high-similarity tracts into:

  • Total at ≥85th percentile — the count of neighborhoods that rank at or above the 85th percentile for resemblance to the brand.
  • Open — how many of those high-similarity neighborhoods do not yet contain a brand location.
  • Already with a store — how many already do.

The 85th percentile threshold is a triage signal: neighborhoods this close to the archetype are candidate expansion sites worth deeper investigation.

How the ranking changes when you focus a metro

Section titled “How the ranking changes when you focus a metro”

When no metro is selected, neighborhoods are ranked by their national similarity percentile — a tract’s position relative to all ~83,000 tracts in the country.

When you select a metro, only that metro’s tracts are ranked. The ranking recomputes live in the browser. A neighborhood that ranks 50th nationally might rank 92nd within its metro if that metro has few stores of that brand; conversely, a tight metro cluster might push lower-national neighborhoods higher within the metro.

The similarity scores themselves do not change — the archetype and distances are the same. Only the percentile assignment changes because the pool of comparable tracts shrinks.

Metro focus works alongside other filters:

  • Open markets only — excludes tracts already containing the brand, showing only expansion opportunities.
  • Minimum similarity — e.g., show only the 75th percentile or above within the metro.
  • State filter — if a metro spans multiple states, you can further narrow to one state.

All three filters apply together, so you can say “In the Portland metro, show me open neighborhoods in Oregon that rank 80th percentile or above for resemblance to Trader Joe’s.”

  • Metro list is loaded from web/public/data/metros.json and rendered in the “Map & filters” section of the left rail in App.tsx.
  • Metro code selection triggers the selectMetro callback in App.tsx, which updates the metroCode state and sets the map view to the metro’s center point and bounding box.
  • Ranking within metro is filtered in the allCandidates memo: a tract is included only if data.cbsa[i] === metroCode (or all tracts when metroCode === 0).
  • Screening rollup is computed in the metroSummary memo, counting tracts in the metro at the 85th percentile or higher and tagging them as open or occupied.

The metro does not change the scoring algorithm or feature weights — it only changes the candidate pool and percentile assignment.