Skip to content

feat: add importance column to conflated.parquet - #853

Merged
brawer merged 1 commit into
mainfrom
importance-column
Oct 26, 2026
Merged

brawer merged 1 commit into
mainfrom
importance-column

Conversation

@brawer

@brawer brawer commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Part of #713: every row of conflated.parquet now has an importance from 0.0 to 1.0, so downstream users can work through the file in priority order.

How it's computed

src/pipeline/importance.rs combines three signals, each already in [0, 1]:

Signal Weight Source
Location 0.4 quantile of the ATP location's OSMViews rank (#851)
Brand 0.3 highest QRank quantile among brand:/operator:/network:wikidata, ATP tags first, else the matched OSM feature's (#848)
Kind of place 0.3 MatchMask::importance() (#852)

A row without a brand drops the brand term, and its weight drops out too, instead of being pushed down. importance is the score's mid-rank quantile among all rows, so importance >= 0.9 always selects the top tenth. The writer collects every score as rows go into the external sort, which has consumed them all before the first row comes back out.

Brands without pageviews now count as no brand. On the Swiss run, Shell's 669 stations carry brand:wikidata=Q110716465, an NSI brand item with no Wikipedia article, and so no pageviews. Under the old floor quantile they ranked below unbranded fuel stations, and they made up the whole bottom of the list. compute_qrank_quantiles now leaves zero-pageview IDs out, both from the table and from the reference population.

Other changes

  • conflate takes the OSMViews raster, osmviews-ranks and qrank-quantiles, and includes them in its freshness check.
  • The provenance BOM lists qrank.csv.gz and osmviews.tiff as components: CC0, with SHA-256, purl, download URL and a link to each publisher's own BOM. Both are also in dependsOn and in the workflow inputs. serialNumber now also hashes their SHA-256s, so a new QRank or OSMViews build gets a new serial number. The anchor timestamp still comes from ATP/OSM only, so file names don't change.
  • Docs: new "Importance" section in docs/outputs/CONFLATED_PARQUET.md; docs/TECHNICAL_DESIGN.md diagram and step list. The diagram now also shows that conflate reads the nondescript phone/email sets, which feat(matchers): match by phone number and email address #850 started doing.

Swiss run

21,808 rows. The top 20 are all pharmacies in central Zurich, Bern and Basel: the two Swiss chains have no pageviews, so their rows count as unbranded with an IMPORTANT category. Below them come McDonald's, Starbucks and Burger King downtown. The bottom is rural fuel stations and kiosks.

Average importance by kind (kinds with at least 40 rows):

Kind Average
police 0.87
school 0.83
pharmacy 0.78
fast_food 0.74
clothes 0.69
supermarket 0.52
fuel 0.41
hotel 0.38
convenience 0.25
restaurant 0.23

conflate took 3.2 s. OsmViews::rank takes a mutex per lookup, so contention on a many-core planet run is worth watching in conflate.match's timing.

Testing

  • Unit tests for score, Quantiles, and a list of "A should beat B" pairs: AED vs flower bed, hospital vs vending machine, AED on a quiet street vs bench on a busy one, among others.
  • Updated QRank tests for zero-pageview brands; provenance tests for the two new components.
  • The integration test checks that importance is present, non-null and in [0, 1].
  • cargo test, cargo clippy --all-targets and cargo fmt --check pass locally.

Generated by Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Nw5ZNMD34EwRUnASRv4jy
@brawer brawer self-assigned this Oct 26, 2026
@github-actions github-actions Bot added the enhancement New feature or request label Oct 26, 2026
@brawer
brawer merged commit 2d017a2 into main Oct 26, 2026
7 of 8 checks passed
@brawer
brawer deleted the importance-column branch October 26, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants