@mailwoman/registry 9.1.0 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/geojson.ts +3 -2
- package/ingest.ts +2 -1
- package/map-html.ts +4 -4
- package/out/geojson.d.ts.map +1 -1
- package/out/geojson.js +3 -2
- package/out/geojson.js.map +1 -1
- package/out/ingest.d.ts.map +1 -1
- package/out/ingest.js +2 -1
- package/out/ingest.js.map +1 -1
- package/out/map-html.d.ts +2 -2
- package/out/map-html.d.ts.map +1 -1
- package/out/map-html.js.map +1 -1
- package/out/reconcile.d.ts.map +1 -1
- package/out/reconcile.js +2 -1
- package/out/reconcile.js.map +1 -1
- package/out/resolve.d.ts.map +1 -1
- package/out/resolve.js +4 -1
- package/out/resolve.js.map +1 -1
- package/out/tools/coverage-reconciliation.js +2 -2
- package/out/tools/coverage-reconciliation.js.map +1 -1
- package/out/tools/cross-dataset-correlation.d.ts.map +1 -1
- package/out/tools/cross-dataset-correlation.js +6 -5
- package/out/tools/cross-dataset-correlation.js.map +1 -1
- package/out/tools/cross-source-threshold-sweep.js +2 -2
- package/out/tools/cross-source-threshold-sweep.js.map +1 -1
- package/out/tools/dedup-ceiling.d.ts.map +1 -1
- package/out/tools/dedup-ceiling.js +2 -3
- package/out/tools/dedup-ceiling.js.map +1 -1
- package/out/tools/eval-geocoder.d.ts +1 -1
- package/out/tools/eval-geocoder.d.ts.map +1 -1
- package/out/tools/geocoder-vs-provided-coords.d.ts.map +1 -1
- package/out/tools/geocoder-vs-provided-coords.js +3 -2
- package/out/tools/geocoder-vs-provided-coords.js.map +1 -1
- package/out/tools/gold-set-sample.d.ts.map +1 -1
- package/out/tools/gold-set-sample.js +4 -3
- package/out/tools/gold-set-sample.js.map +1 -1
- package/out/tools/index.d.ts +1 -6
- package/out/tools/index.d.ts.map +1 -1
- package/out/tools/index.js +1 -6
- package/out/tools/index.js.map +1 -1
- package/out/tools/learned-scorer-clustering-eval.d.ts.map +1 -1
- package/out/tools/learned-scorer-clustering-eval.js +1 -2
- package/out/tools/learned-scorer-clustering-eval.js.map +1 -1
- package/out/tools/learned-scorer-crossstate-eval.d.ts.map +1 -1
- package/out/tools/learned-scorer-crossstate-eval.js +1 -1
- package/out/tools/learned-scorer-crossstate-eval.js.map +1 -1
- package/out/tools/learned-scorer-eval.d.ts.map +1 -1
- package/out/tools/learned-scorer-eval.js +1 -6
- package/out/tools/learned-scorer-eval.js.map +1 -1
- package/out/tools/matcher-scale.d.ts.map +1 -1
- package/out/tools/matcher-scale.js +1 -1
- package/out/tools/matcher-scale.js.map +1 -1
- package/out/tools/nppes/levers.d.ts +38 -0
- package/out/tools/nppes/levers.d.ts.map +1 -0
- package/out/tools/nppes/levers.js +79 -0
- package/out/tools/nppes/levers.js.map +1 -0
- package/out/tools/nppes/org-name.d.ts +24 -0
- package/out/tools/nppes/org-name.d.ts.map +1 -0
- package/out/tools/nppes/org-name.js +42 -0
- package/out/tools/nppes/org-name.js.map +1 -0
- package/out/tools/nppes/overmerge-packet.d.ts +39 -0
- package/out/tools/nppes/overmerge-packet.d.ts.map +1 -0
- package/out/tools/nppes/overmerge-packet.js +55 -0
- package/out/tools/nppes/overmerge-packet.js.map +1 -0
- package/out/tools/nppes/report.d.ts +93 -0
- package/out/tools/nppes/report.d.ts.map +1 -0
- package/out/tools/nppes/report.js +188 -0
- package/out/tools/nppes/report.js.map +1 -0
- package/out/tools/nppes/sample.d.ts +64 -0
- package/out/tools/nppes/sample.d.ts.map +1 -0
- package/out/tools/nppes/sample.js +113 -0
- package/out/tools/nppes/sample.js.map +1 -0
- package/out/tools/nppes/scoring.d.ts +36 -0
- package/out/tools/nppes/scoring.d.ts.map +1 -0
- package/out/tools/nppes/scoring.js +80 -0
- package/out/tools/nppes/scoring.js.map +1 -0
- package/out/tools/nppes/truth-grains.d.ts +50 -0
- package/out/tools/nppes/truth-grains.d.ts.map +1 -0
- package/out/tools/nppes/truth-grains.js +148 -0
- package/out/tools/nppes/truth-grains.js.map +1 -0
- package/out/tools/nppes-dedup-benchmark.d.ts +4 -0
- package/out/tools/nppes-dedup-benchmark.d.ts.map +1 -1
- package/out/tools/nppes-dedup-benchmark.js +79 -652
- package/out/tools/nppes-dedup-benchmark.js.map +1 -1
- package/out/tools/shared.d.ts.map +1 -1
- package/out/tools/shared.js +5 -4
- package/out/tools/shared.js.map +1 -1
- package/out/tools/train-cross-gbt.d.ts.map +1 -1
- package/out/tools/train-cross-gbt.js +2 -2
- package/out/tools/train-cross-gbt.js.map +1 -1
- package/out/tools/train-gbt.d.ts.map +1 -1
- package/out/tools/train-gbt.js +2 -2
- package/out/tools/train-gbt.js.map +1 -1
- package/out/tools/train-org-cross-gbt.d.ts.map +1 -1
- package/out/tools/train-org-cross-gbt.js +2 -2
- package/out/tools/train-org-cross-gbt.js.map +1 -1
- package/out/tools/txhhsc-to-oarow.js +2 -2
- package/out/tools/txhhsc-to-oarow.js.map +1 -1
- package/out/tools/viz/cross-dataset-map.d.ts +2 -23
- package/out/tools/viz/cross-dataset-map.d.ts.map +1 -1
- package/out/tools/viz/cross-dataset-map.js +7 -28
- package/out/tools/viz/cross-dataset-map.js.map +1 -1
- package/out/tools/viz/geocode-first-surface.d.ts +2 -32
- package/out/tools/viz/geocode-first-surface.d.ts.map +1 -1
- package/out/tools/viz/geocode-first-surface.js +4 -33
- package/out/tools/viz/geocode-first-surface.js.map +1 -1
- package/out/tools/viz/render.js +1 -1
- package/out/tools/viz/render.js.map +1 -1
- package/out/tools/viz/source-provenance-map.d.ts +2 -22
- package/out/tools/viz/source-provenance-map.d.ts.map +1 -1
- package/out/tools/viz/source-provenance-map.js +7 -26
- package/out/tools/viz/source-provenance-map.js.map +1 -1
- package/out/types.d.ts +11 -1
- package/out/types.d.ts.map +1 -1
- package/out/types.js.map +1 -1
- package/package.json +78 -9
- package/reconcile.ts +2 -1
- package/resolve.ts +6 -1
- package/tools/coverage-reconciliation.ts +3 -3
- package/tools/cross-dataset-correlation.ts +7 -5
- package/tools/cross-source-threshold-sweep.ts +3 -3
- package/tools/dedup-ceiling.ts +3 -3
- package/tools/eval-geocoder.ts +1 -1
- package/tools/geocoder-vs-provided-coords.ts +4 -2
- package/tools/gold-set-sample.ts +5 -3
- package/tools/index.ts +1 -6
- package/tools/learned-scorer-clustering-eval.ts +4 -4
- package/tools/learned-scorer-crossstate-eval.ts +4 -4
- package/tools/learned-scorer-eval.ts +4 -9
- package/tools/matcher-scale.ts +2 -1
- package/tools/nppes/levers.ts +102 -0
- package/tools/nppes/org-name.ts +56 -0
- package/tools/nppes/overmerge-packet.ts +96 -0
- package/tools/nppes/report.ts +376 -0
- package/tools/nppes/sample.ts +197 -0
- package/tools/nppes/scoring.ts +114 -0
- package/tools/nppes/truth-grains.ts +201 -0
- package/tools/nppes-dedup-benchmark.ts +92 -868
- package/tools/shared.ts +6 -4
- package/tools/train-cross-gbt.ts +6 -5
- package/tools/train-gbt.ts +5 -4
- package/tools/train-org-cross-gbt.ts +6 -5
- package/tools/txhhsc-to-oarow.ts +2 -2
- package/tools/viz/cross-dataset-map.ts +12 -34
- package/tools/viz/geocode-first-surface.ts +5 -33
- package/tools/viz/render.ts +1 -1
- package/tools/viz/source-provenance-map.ts +14 -31
- package/types.ts +10 -1
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
* @file The NPPES dedup benchmark's markdown report. Pure: every figure comes from the input, because eval figures are
|
|
6
|
+
* never hand-typed into docs.
|
|
7
|
+
*/
|
|
8
|
+
import { ORG_TAU } from "./org-name.js";
|
|
9
|
+
import { COLOCATION_KM } from "./truth-grains.js";
|
|
10
|
+
/**
|
|
11
|
+
* F1 gap within which two blocking strategies are treated as equivalent.
|
|
12
|
+
*/
|
|
13
|
+
const BLOCKING_PARITY_TOLERANCE = 0.015;
|
|
14
|
+
/**
|
|
15
|
+
* Render the run's markdown report.
|
|
16
|
+
*/
|
|
17
|
+
export function renderNPPESDedupReport(input) {
|
|
18
|
+
const { state: STATE, keptNpis, recordCount: N, geocoded: geo, trainEM: TRAIN_EM, addressFrequency, progression, defaultOutOfBox, sweep, best, entityCount, orgCount, orgCoordCount, orgH3Count, fsNPI, fsEntity, fsOrg, fsOrgCoord, gbtNPI, gbtEntity, gbtOrg, gbtOrgCoord, gbtOrgH3, candidate: cand, h3Res: H3_RES, geocodedNpis, } = input;
|
|
19
|
+
const baseline = progression[0]; // no levers — the prior-prior behaviour
|
|
20
|
+
// The LAST progression row — the whole A1–A5 stack, never compared on F1 against the others. Named for what it
|
|
21
|
+
// is: a row called `best` invites reading a stack-wide delta as one lever's marginal effect, which is how the
|
|
22
|
+
// authorized-official sentence below came to quote a five-lever number.
|
|
23
|
+
const fullStack = progression.at(-1);
|
|
24
|
+
const base = sweep[0]; // threshold 0, full lever stack
|
|
25
|
+
// NOTE(phase4): local pct keeps the fraction-in/no-%-suffix shape — not core formatPercent's
|
|
26
|
+
// numerator/denominator contract (call sites append their own "%").
|
|
27
|
+
const pct = (x) => (100 * x).toFixed(1);
|
|
28
|
+
const signed = (x) => `${x >= 0 ? "+" : ""}${x.toFixed(1)}pp`;
|
|
29
|
+
const lines = [
|
|
30
|
+
`# NPPES NPI dedup benchmark (#617)`,
|
|
31
|
+
"",
|
|
32
|
+
`_Generated by \`mailwoman registry scorer-eval nppes-benchmark\`. Sample: ${keptNpis} ${STATE} NPIs with ≥1 ` +
|
|
33
|
+
`alternate name → ${N} records (${(N / keptNpis).toFixed(1)}/NPI) from real registry + other-names + ` +
|
|
34
|
+
`mailing-vs-practice variation. Matcher run BLIND to the NPI${TRAIN_EM ? ", EM-trained (label-free)" : ""}; ` +
|
|
35
|
+
`geocoded ${pct(geo / N)}% of addresses. The NPI is held-out ground truth._`,
|
|
36
|
+
"",
|
|
37
|
+
`**Headline — org-name truth (the honest grain):** the shipped ` +
|
|
38
|
+
`matcher resolves these records at **F1 ${pct(gbtOrg.f1)}%** against org-name entity-truth — not the NPI-level ` +
|
|
39
|
+
`${pct(gbtNPI.f1)}%, which mostly measures NPI over-segmentation (one organization holds many subpart NPIs, so ` +
|
|
40
|
+
`correct co-located merges are scored as errors). Same clusters, three rulers: ` +
|
|
41
|
+
`**NPI ${pct(gbtNPI.f1)}% → site ${pct(gbtEntity.f1)}% → org-name ${pct(gbtOrg.f1)}%** ` +
|
|
42
|
+
`(${keptNpis} NPI → ${entityCount} site → ${orgCount} org-name classes); the climb is the yardstick getting honest, ` +
|
|
43
|
+
`not the model changing — gold-set validated (120/120 hard pairs = same org). Details in "Three truth grains" below.`,
|
|
44
|
+
"",
|
|
45
|
+
`## The comparison-model levers (each toggled on, at the default threshold)`,
|
|
46
|
+
"",
|
|
47
|
+
`| model | precision | recall | F1 | ΔF1 | ARI | over-merged |`,
|
|
48
|
+
`|---|---:|---:|---:|---:|---:|---:|`,
|
|
49
|
+
];
|
|
50
|
+
progression.forEach((p, i) => {
|
|
51
|
+
const delta = i === 0 ? "—" : signed(100 * (p.score.f1 - progression[i - 1].score.f1));
|
|
52
|
+
const bold = i === progression.length - 1;
|
|
53
|
+
const w = (s) => (bold ? `**${s}**` : s);
|
|
54
|
+
lines.push(`| ${w(p.label)} | ${w(pct(p.score.precision) + "%")} | ${w(pct(p.score.recall) + "%")} | ${w(pct(p.score.f1) + "%")} | ${delta} | ${w(p.score.ari.toFixed(3))} | ${w(String(p.score.overMergedClusters))} |`);
|
|
55
|
+
});
|
|
56
|
+
lines.push("");
|
|
57
|
+
lines.push(`Inverse-frequency weighting uses the corpus-wide table (${addressFrequency.distinct.toLocaleString()} distinct addresses ` +
|
|
58
|
+
`over ${addressFrequency.total.toLocaleString()} providers) to down-weight a crowded shared address; collapsing the redundant ` +
|
|
59
|
+
`address-key + distance comparisons into one spatial signal (A1) removes the double-count that let a shared address ` +
|
|
60
|
+
`over-vote a disagreeing name. The address-frequency + A1 baseline is F1 ${pct(progression[2].score.f1)}% at the ` +
|
|
61
|
+
`default threshold; the **authorized-official discriminator** is roughly neutral there (${signed(100 * (progression[3].score.f1 - progression[2].score.f1))}) ` +
|
|
62
|
+
`but enables a higher cutoff — it holds recall where the baseline alone collapses, reaching **${pct(best.score.f1)}%** at ` +
|
|
63
|
+
`threshold ${best.t} (below), the first config past the baseline (#625).`);
|
|
64
|
+
lines.push("");
|
|
65
|
+
lines.push(`**Out-of-the-box (zero-config \`resolveEntities(records)\`, levers default-on #86):** F1 ` +
|
|
66
|
+
`**${pct(defaultOutOfBox.f1)}%** on this sample — essentially the baseline. The default auto-computes the ` +
|
|
67
|
+
`address-frequency table over the INPUT records, and this benchmark deliberately sub-samples ${N} records, so ` +
|
|
68
|
+
`that table is too sparse to carry the inverse-frequency signal (a corpus statistic you can't synthesize from a ` +
|
|
69
|
+
`slice). It's **not a regression** (≥ baseline, no over-merge added) — it's the honest floor when the input isn't ` +
|
|
70
|
+
`corpus-scale. Fed the corpus-wide table (the \`+ inverse-address-frequency\` row above, what the CLI builds from ` +
|
|
71
|
+
`the full source files) the SAME default reaches the **${pct(progression[2].score.f1)}%** baseline. On a full-dataset ` +
|
|
72
|
+
`dedup the input IS the corpus, so zero-config reaches the baseline on its own.`);
|
|
73
|
+
lines.push("");
|
|
74
|
+
lines.push(`## With all levers on, across the link threshold (the secondary lever)`);
|
|
75
|
+
lines.push("");
|
|
76
|
+
lines.push(`| link threshold (bits) | precision | recall | F1 | ARI | clusters | over-merged |`);
|
|
77
|
+
lines.push(`|---:|---:|---:|---:|---:|---:|---:|`);
|
|
78
|
+
for (const s of sweep) {
|
|
79
|
+
const star = s === best ? " ⭐" : "";
|
|
80
|
+
lines.push(`| ${s.t}${s.t === 0 ? " (default)" : ""} | ${pct(s.score.precision)}% | ${pct(s.score.recall)}% | **${pct(s.score.f1)}%**${star} | ${s.score.ari.toFixed(3)} | ${s.score.clusters} | ${s.score.overMergedClusters} |`);
|
|
81
|
+
}
|
|
82
|
+
lines.push("");
|
|
83
|
+
lines.push(best.t === 0
|
|
84
|
+
? `Best F1 is at the **default threshold** (${pct(base.score.f1)}%): raising it only trades recall away faster ` +
|
|
85
|
+
`than it buys precision. So the threshold knob alone can't separate co-located distinct providers — the ` +
|
|
86
|
+
`over-merge is structural, in the comparison model, not the cutoff.`
|
|
87
|
+
: `Best F1 **${pct(best.score.f1)}%** (ARI ${best.score.ari.toFixed(3)}) at threshold ${best.t}, vs **${pct(base.score.f1)}%** at the ` +
|
|
88
|
+
`default — the threshold knob moves it ${(100 * (best.score.f1 - base.score.f1)).toFixed(0)}pp. Higher thresholds trade recall for precision.`);
|
|
89
|
+
lines.push("");
|
|
90
|
+
lines.push(`## Shape + where the errors are (at the default threshold)`);
|
|
91
|
+
lines.push("");
|
|
92
|
+
lines.push(`- records: ${N} · true entities (NPIs): ${keptNpis} · recovered clusters: ${base.score.clusters}`);
|
|
93
|
+
lines.push(`- candidate pairs blocked: ${base.res.candidatePairs}${base.res.droppedBlocks.length ? ` · oversized blocks skipped: ${base.res.droppedBlocks.length}` : ""}`);
|
|
94
|
+
lines.push(`- **Over-merge (precision):** ${base.score.overMergedClusters} clusters fuse ≥2 distinct NPIs (largest fuses ` +
|
|
95
|
+
`${base.score.maxNpisFused}; ${base.score.recordsInOverMerged} records) — **co-located providers sharing a clinic / ` +
|
|
96
|
+
`billing address**, linked by address agreement despite different names.`);
|
|
97
|
+
lines.push(`- **Under-merge (recall):** ${base.score.splitNpis}/${keptNpis} NPIs split across >1 cluster — records at distant ` +
|
|
98
|
+
`addresses (mailing vs practice) or with strong name drift the score didn't bridge.`);
|
|
99
|
+
lines.push("");
|
|
100
|
+
lines.push(`## Three truth grains — NPI → site → org-name (the over-segmentation correction)`);
|
|
101
|
+
lines.push("");
|
|
102
|
+
lines.push(`NPI-as-truth OVER-SEGMENTS: one org holds many NPIs, so the matcher's correct co-located merges are scored as ` +
|
|
103
|
+
`errors. Three yardsticks, same clusters: **NPI** (one entity per registration), **site** (subpart-flagged ` +
|
|
104
|
+
`collapse + split an NPI's distinct addresses), and **org-name** — the gold-set-validated truth: same NPI ⇒ ` +
|
|
105
|
+
`same entity (recall preserved) PLUS collapse co-located NPIs whose primary org names match (Jaccard ≥ ${ORG_TAU}), ` +
|
|
106
|
+
`with NO reliance on the subpart flag (the gold set showed it misses 37%). The same ${N} records carry ` +
|
|
107
|
+
`**${keptNpis} NPI** → **${entityCount} site** → **${orgCount} org-name** classes. The org-name number is the ` +
|
|
108
|
+
`honest one: it stops charging the matcher for the same-org merges the gold set proved are correct.`);
|
|
109
|
+
lines.push("");
|
|
110
|
+
lines.push(`| config | truth | precision | recall | F1 | ΔF1 vs NPI | ARI | over-merged |`);
|
|
111
|
+
lines.push(`|---|---|---:|---:|---:|---:|---:|---:|`);
|
|
112
|
+
const dualRow = (label, truth, s, delta) => lines.push(`| ${label} | ${truth} | ${pct(s.precision)}% | ${pct(s.recall)}% | **${pct(s.f1)}%** | ${delta === undefined ? "—" : signed(100 * delta)} | ${s.ari.toFixed(3)} | ${s.overMergedClusters} |`);
|
|
113
|
+
dualRow("FS full stack", "NPI", fsNPI);
|
|
114
|
+
dualRow("FS full stack", "site", fsEntity, fsEntity.f1 - fsNPI.f1);
|
|
115
|
+
dualRow("FS full stack", "**org-name**", fsOrg, fsOrg.f1 - fsNPI.f1);
|
|
116
|
+
dualRow("FS full stack", "org-name (coord)", fsOrgCoord, fsOrgCoord.f1 - fsNPI.f1);
|
|
117
|
+
dualRow("GBT (shipped default)", "NPI", gbtNPI);
|
|
118
|
+
dualRow("GBT (shipped default)", "site", gbtEntity, gbtEntity.f1 - gbtNPI.f1);
|
|
119
|
+
dualRow("GBT (shipped default)", "**org-name**", gbtOrg, gbtOrg.f1 - gbtNPI.f1);
|
|
120
|
+
dualRow("GBT (shipped default)", "**org-name (coord)**", gbtOrgCoord, gbtOrgCoord.f1 - gbtNPI.f1);
|
|
121
|
+
dualRow("GBT (shipped default)", `org-name (H3 res ${H3_RES})`, gbtOrgH3, gbtOrgH3.f1 - gbtNPI.f1);
|
|
122
|
+
if (cand) {
|
|
123
|
+
dualRow(cand.label, "NPI", cand.npi);
|
|
124
|
+
dualRow(cand.label, "**entity**", cand.entity, cand.entity.f1 - cand.npi.f1);
|
|
125
|
+
}
|
|
126
|
+
lines.push("");
|
|
127
|
+
lines.push(`The F1 **climbs as the yardstick gets honest**: GBT **${pct(gbtNPI.f1)}% (NPI) → ${pct(gbtEntity.f1)}% (site) → ` +
|
|
128
|
+
`${pct(gbtOrg.f1)}% (org-name)**, the over-merge collapsing (${gbtNPI.overMergedClusters} → ${gbtOrg.overMergedClusters}) ` +
|
|
129
|
+
`and precision rising (${pct(gbtNPI.precision)}% → ${pct(gbtOrg.precision)}%). The clusters are IDENTICAL across the three ` +
|
|
130
|
+
`columns — the climb is purely the ruler ceasing to charge the matcher for the correct same-org merges the gold set proved ` +
|
|
131
|
+
`(\`2026-06-16-dedup-gold-set-tx120.md\`: 120/120 same org, 0 genuine over-merges).`);
|
|
132
|
+
lines.push("");
|
|
133
|
+
lines.push(`**Tier 2D — tightening the org-name ruler with the geocode coordinate.** The org-name truth above blocks by the address ` +
|
|
134
|
+
`STRING (\`addressFrequencyKey\`), so two records at one building whose text differs — \`1504 Taub LOOP\` vs ` +
|
|
135
|
+
`\`1504 Taub LP STE 100\` — key apart and the merge is still charged as an error. Block by the GEOCODED BUILDING instead ` +
|
|
136
|
+
`(union co-located NPIs within ${COLOCATION_KM * 1000} m whose org names agree, same Jaccard gate) and the truth tightens ` +
|
|
137
|
+
`further: GBT **org-name ${pct(gbtOrg.f1)}% → org-name-coord ${pct(gbtOrgCoord.f1)}%** ` +
|
|
138
|
+
`(${signed(100 * (gbtOrgCoord.f1 - gbtOrg.f1))}), ${orgCount} → ${orgCoordCount} classes, over ${geocodedNpis}/${keptNpis} ` +
|
|
139
|
+
`geocoded NPIs. The string org-name F1 is a conservative LOWER bound; the coordinate one is tighter (the Jaccard gate ` +
|
|
140
|
+
`still blocks distinct co-located orgs). Both are honest — the coordinate is the geocode-first key.`);
|
|
141
|
+
lines.push("");
|
|
142
|
+
lines.push(`**H3-cell robustness check (#109).** Re-keying the same building-grain co-location on an H3 cell ` +
|
|
143
|
+
`(res ${H3_RES}) instead of the 50 m haversine radius — the deterministic, O(n) "geocode-first cell" the issue ` +
|
|
144
|
+
`suggested — gives GBT **org-name-h3 ${pct(gbtOrgH3.f1)}%** (${orgH3Count} classes), vs the haversine ` +
|
|
145
|
+
`${pct(gbtOrgCoord.f1)}% (${orgCoordCount}). ${Math.abs(gbtOrgH3.f1 - gbtOrgCoord.f1) < BLOCKING_PARITY_TOLERANCE
|
|
146
|
+
? "Within noise of the haversine grain — the ~" +
|
|
147
|
+
pct(gbtOrgCoord.f1) +
|
|
148
|
+
"% coord-grain F1 is robust to the co-location method, not an artifact of the 50 m threshold."
|
|
149
|
+
: "The two co-location methods differ by " +
|
|
150
|
+
signed(100 * (gbtOrgH3.f1 - gbtOrgCoord.f1)) +
|
|
151
|
+
" — the cell-vs-radius boundary handling shifts the count (a hard H3 boundary can split a same-building pair into adjacent cells)."}`);
|
|
152
|
+
lines.push("");
|
|
153
|
+
lines.push(`**Takeaways:** (1) The dedup model's REAL quality is the **org-name F1 ~${pct(gbtOrg.f1)}%**, not the NPI-level ` +
|
|
154
|
+
`${pct(gbtNPI.f1)}% — the difference was NPI over-segmentation, not model error. (2) The #625 lever was the YARDSTICK, ` +
|
|
155
|
+
`not the scorer: the corroboration-feature experiment (reverted) couldn't move precision because the over-merge was ` +
|
|
156
|
+
`mostly correct. (3) The remaining org-name over-merge (${gbtOrg.overMergedClusters} clusters) is the genuine frontier — ` +
|
|
157
|
+
`small, approaching the ceiling's ~1.6% irreducible (\`2026-06-16-dedup-ceiling.md\`). (4) Trust the large eval: a 50-NPI ` +
|
|
158
|
+
`smoke misled on the site delta (+5–7pp vs this run's ±2pp).`);
|
|
159
|
+
lines.push("");
|
|
160
|
+
lines.push(`Caveats: the programmatic site-truth is CONSERVATIVE (collapses only NPPES-flagged subparts; unflagged same-org pairs still ` +
|
|
161
|
+
`read as over-merge), so it understates the subpart correction. A hand-adjudicated gold set on the ambiguous co-located + ` +
|
|
162
|
+
`two-site slice is the next refinement (#625).`);
|
|
163
|
+
lines.push("");
|
|
164
|
+
lines.push(`## Reading`);
|
|
165
|
+
lines.push("");
|
|
166
|
+
lines.push(`The geocode-first **foundation works**: **${pct(geo / N)}%** of addresses placed, blocking + clustering clean — the ` +
|
|
167
|
+
`geocoding (the Pelias/Nominatim-can't-do-this part) is not the bottleneck. The comparison-model levers reach the ` +
|
|
168
|
+
`address-frequency + A1 baseline at F1 **${pct(progression[2].score.f1)}%** (${signed(100 * (progression[2].score.f1 - baseline.score.f1))} over baseline): ` +
|
|
169
|
+
`inverse-frequency weighting restores full weight to a *rare* shared address (stitching a provider's name-drifted ` +
|
|
170
|
+
`records together — mostly recall) while down-weighting a *crowded* one, and the collapsed spatial signal (A1) drops ` +
|
|
171
|
+
`the address+distance double-count. What remains is **precision / over-merge** — ${fullStack.score.overMergedClusters} ` +
|
|
172
|
+
`clusters still fuse distinct co-located providers, because even one down-weighted spatial agreement can outvote a ` +
|
|
173
|
+
`disagreeing name. The lever search (#625) — two negatives, then the first positive: a name/org/phone ` +
|
|
174
|
+
`**corroboration gate** (A2/A3) — phone is an unreliable secondary identifier on NPPES (shared institutional ` +
|
|
175
|
+
`switchboard lines), so it over-links and falsely corroborates co-phone distinct providers; and **average-linkage ` +
|
|
176
|
+
`clustering** (A4) — the over-merged clusters are joined by STRONG shared-address edges, not weak bridges, so ` +
|
|
177
|
+
`average-linkage can't split them and only trades away name-drift recall. The over-merge is a **scoring** problem ` +
|
|
178
|
+
`this data can't resolve, not a clustering-topology one. The **authorized-official discriminator** is the first lever to beat the baseline — a reliable secondary identifier holds recall so a higher threshold separates the co-located providers; a still-more-distinctive identifier ` +
|
|
179
|
+
`(taxonomy / license) or a learned scorer over the FS feature vector (#603) goes further. Config ` +
|
|
180
|
+
`dominates the model (the pre-registered finding) — tracked as #625 / the selective-model work (#602 / #603).`);
|
|
181
|
+
lines.push("");
|
|
182
|
+
lines.push(`NPI-as-truth is **conservative**: a cluster fusing two NPIs is a candidate "same entity, two NPIs" surfaced for ` +
|
|
183
|
+
`review, not an adjudicated error; an NPI split across genuinely-distant addresses is geo-first behaving correctly, ` +
|
|
184
|
+
`counted here as a recall miss. We resolve and report; interpretation is the consumer's.`);
|
|
185
|
+
lines.push("");
|
|
186
|
+
return lines.join("\n");
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../../tools/nppes/report.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD;;GAEG;AACH,MAAM,yBAAyB,GAAG,KAAK,CAAA;AA+EvC;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAuB;IAC7D,MAAM,EACL,KAAK,EAAE,KAAK,EACZ,QAAQ,EACR,WAAW,EAAE,CAAC,EACd,QAAQ,EAAE,GAAG,EACb,OAAO,EAAE,QAAQ,EACjB,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,KAAK,EACL,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,aAAa,EACb,UAAU,EACV,KAAK,EACL,QAAQ,EACR,KAAK,EACL,UAAU,EACV,MAAM,EACN,SAAS,EACT,MAAM,EACN,WAAW,EACX,QAAQ,EACR,SAAS,EAAE,IAAI,EACf,KAAK,EAAE,MAAM,EACb,YAAY,GACZ,GAAG,KAAK,CAAA;IAET,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAE,CAAA,CAAC,wCAAwC;IACzE,+GAA+G;IAC/G,8GAA8G;IAC9G,wEAAwE;IACxE,MAAM,SAAS,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,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K,CAAC,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,mBAAmB;QAC/J,mHAAmH;QACnH,sHAAsH;QACtH,mFAAmF,SAAS,CAAC,KAAK,CAAC,kBAAkB,GAAG;QACxH,oHAAoH;QACpH,uGAAuG;QACvG,8GAA8G;QAC9G,mHAAmH;QACnH,+GAA+G;QAC/G,mHAAmH;QACnH,yRAAyR;QACzR,kGAAkG;QAClG,8GAA8G,CAC/G,CAAA;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAEd,KAAK,CAAC,IAAI,CACT,kHAAkH;QACjH,qHAAqH;QACrH,yFAAyF,CAC1F,CAAA;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAEd,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACxB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
* @file The NPPES benchmark's input sample: the variation-rich multi-record set per NPI, plus the corpus-wide
|
|
6
|
+
* address-frequency table built in the same pass.
|
|
7
|
+
*/
|
|
8
|
+
import type { TermFrequencyTable } from "@mailwoman/match";
|
|
9
|
+
import { type NPIPrimary } from "./org-name.ts";
|
|
10
|
+
/**
|
|
11
|
+
* One synthetic input row for the matcher; `npi` is the hidden NPI-level truth, `entityID` the site-level entity-level
|
|
12
|
+
* truth (subpart-collapsed).
|
|
13
|
+
*/
|
|
14
|
+
export interface MessyRow extends Record<string, string> {
|
|
15
|
+
npi: string;
|
|
16
|
+
name: string;
|
|
17
|
+
org: string;
|
|
18
|
+
address: string;
|
|
19
|
+
auth: string;
|
|
20
|
+
/**
|
|
21
|
+
* Whitespace-joined taxonomy-code set (up to 15 slots) — the #625 code-set discriminator.
|
|
22
|
+
*/
|
|
23
|
+
taxonomy: string;
|
|
24
|
+
entityID: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* What the sample pass yields.
|
|
28
|
+
*/
|
|
29
|
+
export interface NPPESSample {
|
|
30
|
+
rows: MessyRow[];
|
|
31
|
+
/**
|
|
32
|
+
* The sampled NPIs — the true-entity count at the NPI grain.
|
|
33
|
+
*/
|
|
34
|
+
keptNpis: Set<string>;
|
|
35
|
+
/**
|
|
36
|
+
* Per-NPI primary org name + practice address key, the basis for the org-name entity truths.
|
|
37
|
+
*/
|
|
38
|
+
npiPrimary: Map<string, NPIPrimary>;
|
|
39
|
+
/**
|
|
40
|
+
* Corpus-wide address-frequency table — the inverse-frequency signal. Counted over EVERY practice address in the
|
|
41
|
+
* registry, not just the sample, so the sharing structure is a corpus statistic rather than a slice artifact.
|
|
42
|
+
*/
|
|
43
|
+
addressFrequency: TermFrequencyTable;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Where the sample comes from and how much of it to take.
|
|
47
|
+
*/
|
|
48
|
+
export interface NPPESSampleOptions {
|
|
49
|
+
registryPath: string;
|
|
50
|
+
otherNamesPath: string;
|
|
51
|
+
/**
|
|
52
|
+
* Already upper-cased; compared against the practice-location state column.
|
|
53
|
+
*/
|
|
54
|
+
state: string;
|
|
55
|
+
maxNpis: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Build the benchmark's input records from the real registry.
|
|
59
|
+
*
|
|
60
|
+
* Two passes over two files, and the SECOND one cannot break early: the address-frequency table needs every registry
|
|
61
|
+
* row even after the sample is full, so the `kept.size < maxNpis` test gates only the sample branch.
|
|
62
|
+
*/
|
|
63
|
+
export declare function buildNPPESSample(options: NPPESSampleOptions, report?: (line: string) => void): Promise<NPPESSample>;
|
|
64
|
+
//# sourceMappingURL=sample.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sample.d.ts","sourceRoot":"","sources":["../../../tools/nppes/sample.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAK1D,OAAO,EAAa,KAAK,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1D;;;GAGG;AACH,MAAM,WAAW,QAAS,SAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IACvD,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,QAAQ,EAAE,CAAA;IAChB;;OAEG;IACH,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACrB;;OAEG;IACH,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IACnC;;;OAGG;IACH,gBAAgB,EAAE,kBAAkB,CAAA;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,MAAM,CAAA;IACtB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;CACf;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACrC,OAAO,EAAE,kBAAkB,EAC3B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC,WAAW,CAAC,CAyHtB"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
* @file The NPPES benchmark's input sample: the variation-rich multi-record set per NPI, plus the corpus-wide
|
|
6
|
+
* address-frequency table built in the same pass.
|
|
7
|
+
*/
|
|
8
|
+
import { isPresent } from "@mailwoman/core/objects";
|
|
9
|
+
import { addressFrequencyKey, streamRows } from "#index";
|
|
10
|
+
import { addr, MIN_GROUP_SIZE, norm, NPPES_COLUMNS as C } from "../shared.js";
|
|
11
|
+
import { orgTokens } from "./org-name.js";
|
|
12
|
+
/**
|
|
13
|
+
* Build the benchmark's input records from the real registry.
|
|
14
|
+
*
|
|
15
|
+
* Two passes over two files, and the SECOND one cannot break early: the address-frequency table needs every registry
|
|
16
|
+
* row even after the sample is full, so the `kept.size < maxNpis` test gates only the sample branch.
|
|
17
|
+
*/
|
|
18
|
+
export async function buildNPPESSample(options, report) {
|
|
19
|
+
const { registryPath, otherNamesPath, state, maxNpis } = options;
|
|
20
|
+
// --- Phase A: the variation set — NPIs that carry ≥1 alternate organization name. ---
|
|
21
|
+
report?.("[A] streaming other-names…");
|
|
22
|
+
const altNames = new Map();
|
|
23
|
+
for await (const r of streamRows(otherNamesPath)) {
|
|
24
|
+
const npi = norm(r[C.npi]);
|
|
25
|
+
const alt = norm(r[C.otherOrg]);
|
|
26
|
+
if (!npi || !alt)
|
|
27
|
+
continue;
|
|
28
|
+
const list = altNames.get(npi) ?? [];
|
|
29
|
+
if (list.length < MIN_GROUP_SIZE) {
|
|
30
|
+
list.push(alt);
|
|
31
|
+
}
|
|
32
|
+
// cap fan-out per NPI
|
|
33
|
+
altNames.set(npi, list);
|
|
34
|
+
}
|
|
35
|
+
report?.(` ${altNames.size} NPIs with ≥1 alternate name`);
|
|
36
|
+
// --- Phase B: ONE full registry pass — build the GLOBAL address-frequency table (every practice
|
|
37
|
+
// address, so the sharing structure is corpus-wide, not sample-biased) AND collect the sample. ---
|
|
38
|
+
report?.(`[B] full registry pass: address-frequency table + ${maxNpis} ${state} sample…`);
|
|
39
|
+
const rows = [];
|
|
40
|
+
const kept = new Set();
|
|
41
|
+
// Per-NPI primary org name + practice address key — the basis for the ORG-NAME entity-truth.
|
|
42
|
+
const npiPrimary = new Map();
|
|
43
|
+
const addrCounts = new Map();
|
|
44
|
+
let addrTotal = 0;
|
|
45
|
+
let scanned = 0;
|
|
46
|
+
for await (const r of streamRows(registryPath)) {
|
|
47
|
+
if (++scanned % 1_000_000 === 0) {
|
|
48
|
+
report?.(` scanned ${scanned / 1e6}M rows, kept ${kept.size}`);
|
|
49
|
+
}
|
|
50
|
+
const practice = addr(r[C.pAddr], r[C.pCity], r[C.pState], r[C.pZip]);
|
|
51
|
+
// Global address-frequency: count every practice address (one row ≈ one distinct NPI).
|
|
52
|
+
if (practice) {
|
|
53
|
+
const k = addressFrequencyKey(practice);
|
|
54
|
+
addrCounts.set(k, (addrCounts.get(k) ?? 0) + 1);
|
|
55
|
+
addrTotal++;
|
|
56
|
+
}
|
|
57
|
+
// Sample: in-state NPIs with ≥1 alternate name, up to maxNpis — NO early break (the table needs the full pass).
|
|
58
|
+
const npi = norm(r[C.npi]);
|
|
59
|
+
if (kept.size < maxNpis &&
|
|
60
|
+
npi &&
|
|
61
|
+
!kept.has(npi) &&
|
|
62
|
+
altNames.has(npi) &&
|
|
63
|
+
practice &&
|
|
64
|
+
norm(r[C.pState]).toUpperCase() === state) {
|
|
65
|
+
const isOrg = norm(r[C.entityType]) === "2";
|
|
66
|
+
const primaryName = isOrg ? norm(r[C.orgLegal]) : `${norm(r[C.first])} ${norm(r[C.last])}`.trim();
|
|
67
|
+
if (primaryName) {
|
|
68
|
+
const org = isOrg ? norm(r[C.orgLegal]) : "";
|
|
69
|
+
const auth = `${norm(r[C.authFirst])} ${norm(r[C.authLast])}`.trim();
|
|
70
|
+
// the NPI's registrant — shared across its records
|
|
71
|
+
// #625: the taxonomy-code set (up to 15 slots), whitespace-joined — identical across the NPI's
|
|
72
|
+
// records by construction (it's a per-NPI registry attribute), so it NEVER splits one entity;
|
|
73
|
+
// it only separates co-located DISTINCT providers whose sets are disjoint.
|
|
74
|
+
const taxonomy = C.taxonomy
|
|
75
|
+
.map((col) => norm(r[col]))
|
|
76
|
+
.filter(isPresent)
|
|
77
|
+
.join(" ");
|
|
78
|
+
// Entity-level (site) truth: same org + same physical address. Subparts (NPPES
|
|
79
|
+
// "Is Organization Subpart" + parent LBN/TIN) collapse to their PARENT, so the matcher isn't
|
|
80
|
+
// charged for correctly fusing one org's many subpart-NPIs at a site; an NPI's mailing-vs-
|
|
81
|
+
// practice records stay DISTINCT sites. orgKey = parent identity for subparts, else the NPI
|
|
82
|
+
// (independent orgs sharing an address stay distinct — the conservative choice).
|
|
83
|
+
const isSubpart = norm(r[C.isSubpart]).toUpperCase() === "Y";
|
|
84
|
+
const parentKey = `${norm(r[C.parentLBN])}|${norm(r[C.parentTIN])}`.toLowerCase();
|
|
85
|
+
const orgKey = isSubpart && parentKey !== "|" ? `p:${parentKey}` : `n:${npi}`;
|
|
86
|
+
const eid = (a) => `${addressFrequencyKey(a)}|${orgKey}`;
|
|
87
|
+
if (org) {
|
|
88
|
+
npiPrimary.set(npi, { tokens: orgTokens(org), addrKey: addressFrequencyKey(practice) });
|
|
89
|
+
}
|
|
90
|
+
kept.add(npi);
|
|
91
|
+
rows.push({ npi, name: primaryName, org, address: practice, auth, taxonomy, entityID: eid(practice) });
|
|
92
|
+
// primary
|
|
93
|
+
for (const alt of altNames.get(npi)) {
|
|
94
|
+
rows.push({ npi, name: alt, org: alt, address: practice, auth, taxonomy, entityID: eid(practice) });
|
|
95
|
+
}
|
|
96
|
+
// name drift
|
|
97
|
+
const mailing = addr(r[C.mAddr], r[C.mCity], r[C.mState], r[C.mZip]);
|
|
98
|
+
if (mailing && mailing !== practice) {
|
|
99
|
+
rows.push({ npi, name: primaryName, org, address: mailing, auth, taxonomy, entityID: eid(mailing) });
|
|
100
|
+
} // address variation
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// Corpus-wide address-frequency table — the inverse-frequency signal (#617 fix per the DeepSeek consult).
|
|
105
|
+
const addressFrequency = {
|
|
106
|
+
total: addrTotal,
|
|
107
|
+
distinct: addrCounts.size,
|
|
108
|
+
frequency: (v) => (v ? (addrCounts.get(addressFrequencyKey(v)) ?? 0) / addrTotal : 0),
|
|
109
|
+
};
|
|
110
|
+
report?.(` ${kept.size} NPIs → ${rows.length} records; address table: ${addrCounts.size} distinct over ${addrTotal} rows`);
|
|
111
|
+
return { rows, keptNpis: kept, npiPrimary, addressFrequency };
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=sample.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sample.js","sourceRoot":"","sources":["../../../tools/nppes/sample.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAGnD,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAExD,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,IAAI,CAAC,EAAE,MAAM,cAAc,CAAA;AAC7E,OAAO,EAAE,SAAS,EAAmB,MAAM,eAAe,CAAA;AAoD1D;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACrC,OAA2B,EAC3B,MAA+B;IAE/B,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,OAAO,CAAA;IAEhE,uFAAuF;IACvF,MAAM,EAAE,CAAC,4BAA4B,CAAC,CAAA;IACtC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAoB,CAAA;IAE5C,IAAI,KAAK,EAAE,MAAM,CAAC,IAAI,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;QAClD,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;QAC1B,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAA;QAE/B,IAAI,CAAC,GAAG,IAAI,C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AAmB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;KAC7F,CAAA;IAED,MAAM,EAAE,CACP,OAAO,IAAI,CAAC,IAAI,WAAW,IAAI,CAAC,MAAM,4BAA4B,UAAU,CAAC,IAAI,kBAAkB,SAAS,OAAO,CACnH,CAAA;IAED,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAA;AAC9D,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
* @file Pairwise cluster scoring for the NPPES benchmark — precision/recall/F1 and adjusted Rand of recovered clusters
|
|
6
|
+
* against a truth labelling, plus the over-merge / under-merge shape counts.
|
|
7
|
+
*/
|
|
8
|
+
import type { ResolvedEntity, SourceRecord } from "#index";
|
|
9
|
+
/**
|
|
10
|
+
* Pairs within a group of `n`.
|
|
11
|
+
*/
|
|
12
|
+
export declare const choose2: (n: number) => number;
|
|
13
|
+
/**
|
|
14
|
+
* One clustering scored against one truth labelling.
|
|
15
|
+
*/
|
|
16
|
+
export interface Score {
|
|
17
|
+
precision: number;
|
|
18
|
+
recall: number;
|
|
19
|
+
f1: number;
|
|
20
|
+
ari: number;
|
|
21
|
+
clusters: number;
|
|
22
|
+
singletons: number;
|
|
23
|
+
overMergedClusters: number;
|
|
24
|
+
recordsInOverMerged: number;
|
|
25
|
+
maxNpisFused: number;
|
|
26
|
+
splitNpis: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Score recovered clusters against a truth labelling.
|
|
30
|
+
*
|
|
31
|
+
* Pairwise, not set-matching: a true pair is two records carrying the same `labelOf`, a predicted pair is two records
|
|
32
|
+
* in the same entity. `totalRecords` is the labelled population and only feeds the adjusted-Rand expectation, so it
|
|
33
|
+
* must be the whole record set rather than the clustered subset — a smaller value inflates ARI.
|
|
34
|
+
*/
|
|
35
|
+
export declare function scoreEntities(entities: readonly ResolvedEntity[], labelOf: (rec: SourceRecord) => string, totalRecords: number): Score;
|
|
36
|
+
//# sourceMappingURL=scoring.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoring.d.ts","sourceRoot":"","sources":["../../../tools/nppes/scoring.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAE1D;;GAEG;AACH,eAAO,MAAM,OAAO,GAAI,GAAG,MAAM,KAAG,MAA2B,CAAA;AAE/D;;GAEG;AACH,MAAM,WAAW,KAAK;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,mBAAmB,EAAE,MAAM,CAAA;IAC3B,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC5B,QAAQ,EAAE,SAAS,cAAc,EAAE,EACnC,OAAO,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,MAAM,EACtC,YAAY,EAAE,MAAM,GAClB,KAAK,CAuEP"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
* @file Pairwise cluster scoring for the NPPES benchmark — precision/recall/F1 and adjusted Rand of recovered clusters
|
|
6
|
+
* against a truth labelling, plus the over-merge / under-merge shape counts.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Pairs within a group of `n`.
|
|
10
|
+
*/
|
|
11
|
+
export const choose2 = (n) => (n * (n - 1)) / 2;
|
|
12
|
+
/**
|
|
13
|
+
* Score recovered clusters against a truth labelling.
|
|
14
|
+
*
|
|
15
|
+
* Pairwise, not set-matching: a true pair is two records carrying the same `labelOf`, a predicted pair is two records
|
|
16
|
+
* in the same entity. `totalRecords` is the labelled population and only feeds the adjusted-Rand expectation, so it
|
|
17
|
+
* must be the whole record set rather than the clustered subset — a smaller value inflates ARI.
|
|
18
|
+
*/
|
|
19
|
+
export function scoreEntities(entities, labelOf, totalRecords) {
|
|
20
|
+
const npiTotals = new Map();
|
|
21
|
+
const npiClusters = new Map();
|
|
22
|
+
let sumCK = 0; // Σ C(n_ck, 2)
|
|
23
|
+
let sumCluster = 0; // Σ_c C(|c|, 2)
|
|
24
|
+
let singletons = 0;
|
|
25
|
+
let overMergedClusters = 0;
|
|
26
|
+
let recordsInOverMerged = 0;
|
|
27
|
+
let maxNpisFused = 0;
|
|
28
|
+
entities.forEach((e, ci) => {
|
|
29
|
+
const byNPI = new Map();
|
|
30
|
+
for (const rec of e.records) {
|
|
31
|
+
const lbl = labelOf(rec);
|
|
32
|
+
byNPI.set(lbl, (byNPI.get(lbl) ?? 0) + 1);
|
|
33
|
+
}
|
|
34
|
+
sumCluster += choose2(e.records.length);
|
|
35
|
+
if (e.records.length === 1) {
|
|
36
|
+
singletons++;
|
|
37
|
+
}
|
|
38
|
+
if (byNPI.size > 1) {
|
|
39
|
+
overMergedClusters++;
|
|
40
|
+
recordsInOverMerged += e.records.length;
|
|
41
|
+
maxNpisFused = Math.max(maxNpisFused, byNPI.size);
|
|
42
|
+
}
|
|
43
|
+
for (const [npi, n] of byNPI) {
|
|
44
|
+
sumCK += choose2(n);
|
|
45
|
+
npiTotals.set(npi, (npiTotals.get(npi) ?? 0) + n);
|
|
46
|
+
}
|
|
47
|
+
for (const rec of e.records) {
|
|
48
|
+
const lbl = labelOf(rec);
|
|
49
|
+
const s = npiClusters.get(lbl) ?? new Set();
|
|
50
|
+
s.add(ci);
|
|
51
|
+
npiClusters.set(lbl, s);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
let sumClass = 0;
|
|
55
|
+
// Σ_k C(|k|, 2)
|
|
56
|
+
for (const total of npiTotals.values()) {
|
|
57
|
+
sumClass += choose2(total);
|
|
58
|
+
}
|
|
59
|
+
const tp = sumCK;
|
|
60
|
+
const precision = tp + (sumCluster - tp) > 0 ? tp / sumCluster : 0;
|
|
61
|
+
const recall = sumClass > 0 ? tp / sumClass : 0;
|
|
62
|
+
const f1 = precision + recall > 0 ? (2 * precision * recall) / (precision + recall) : 0;
|
|
63
|
+
const expected = (sumCluster * sumClass) / choose2(totalRecords);
|
|
64
|
+
const maxIndex = (sumCluster + sumClass) / 2;
|
|
65
|
+
const ari = maxIndex - expected !== 0 ? (tp - expected) / (maxIndex - expected) : 1;
|
|
66
|
+
const splitNpis = [...npiClusters.values()].filter((s) => s.size > 1).length;
|
|
67
|
+
return {
|
|
68
|
+
precision,
|
|
69
|
+
recall,
|
|
70
|
+
f1,
|
|
71
|
+
ari,
|
|
72
|
+
clusters: entities.length,
|
|
73
|
+
singletons,
|
|
74
|
+
overMergedClusters,
|
|
75
|
+
recordsInOverMerged,
|
|
76
|
+
maxNpisFused,
|
|
77
|
+
splitNpis,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=scoring.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scoring.js","sourceRoot":"","sources":["../../../tools/nppes/scoring.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAkB/D;;;;;;GAMG;AACH,MAAM,U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GAAG,CAAC,UAAU,GAAG,QAAQ,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;IAChE,MAAM,QAAQ,GAAG,CAAC,UAAU,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAA;IAC5C,MAAM,GAAG,GAAG,QAAQ,GAAG,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACnF,MAAM,SAAS,GAAG,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,MAAM,CAAA;IAE5E,OAAO;QACN,SAAS;QACT,MAAM;QACN,EAAE;QACF,GAAG;QACH,QAAQ,EAAE,QAAQ,CAAC,MAAM;QACzB,UAAU;QACV,kBAAkB;QAClB,mBAAmB;QACnB,YAAY;QACZ,SAAS;KACT,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
* @file The org-name entity-truth grains: union-find labellings that collapse co-located same-org NPIs, keyed three
|
|
6
|
+
* ways — the address string, a haversine co-location radius, and an H3 cell.
|
|
7
|
+
*/
|
|
8
|
+
import { type LatLon } from "@mailwoman/match";
|
|
9
|
+
import type { SourceRecord } from "#index";
|
|
10
|
+
import { type NPIPrimary } from "./org-name.ts";
|
|
11
|
+
/**
|
|
12
|
+
* Same-building distance for the coordinate grain — the `DEFAULT_DISTANCE_LEVELS` grain.
|
|
13
|
+
*/
|
|
14
|
+
export declare const COLOCATION_KM = 0.05;
|
|
15
|
+
/**
|
|
16
|
+
* A truth labelling: the entity class a record belongs to.
|
|
17
|
+
*/
|
|
18
|
+
export type TruthLabel = (rec: SourceRecord) => string;
|
|
19
|
+
/**
|
|
20
|
+
* An NPI's primary practice coordinate — the FIRST geocoded record it owns, which is its primary row because the sample
|
|
21
|
+
* builder pushes that row before the alternate-name and mailing variants.
|
|
22
|
+
*/
|
|
23
|
+
export declare function collectPrimaryCoordinates(records: readonly SourceRecord[]): Map<string, LatLon>;
|
|
24
|
+
/**
|
|
25
|
+
* The string-keyed org-name truth: same NPI ⇒ same entity (so an NPI's records stay together and recall is preserved),
|
|
26
|
+
* PLUS union two NPIs at the same address KEY whose primary org names agree.
|
|
27
|
+
*
|
|
28
|
+
* Blocking on the address string is a conservative LOWER bound — `1504 Taub LOOP` and `1504 Taub LP STE 100` key apart
|
|
29
|
+
* even though they are one building, so a correct merge across them is still charged as an error. The coordinate grain
|
|
30
|
+
* below is the tighter reading. Neither relies on the NPPES subpart flag, which the gold set showed misses 37%.
|
|
31
|
+
*/
|
|
32
|
+
export declare function buildOrgNameGrain(npiPrimary: Map<string, NPIPrimary>): TruthLabel;
|
|
33
|
+
/**
|
|
34
|
+
* The coordinate-keyed org-name truth: union same-org NPIs whose primary practice coordinates fall within
|
|
35
|
+
* {@linkcode COLOCATION_KM}. Blocking by the GEOCODED BUILDING catches the same-building pairs the address string keys
|
|
36
|
+
* apart, so this F1 is at or above the string grain's; the Jaccard gate still blocks distinct co-located orgs.
|
|
37
|
+
*
|
|
38
|
+
* Brute-force pairwise over the sampled NPIs — trivial at this scale, and unlike a cell key it has no boundary
|
|
39
|
+
* artifact.
|
|
40
|
+
*/
|
|
41
|
+
export declare function buildOrgNameCoordGrain(npiPrimary: Map<string, NPIPrimary>, npiCoord: Map<string, LatLon>): TruthLabel;
|
|
42
|
+
/**
|
|
43
|
+
* The H3-cell org-name truth — the same building grain keyed on a cell instead of a radius, so co-location blocking is
|
|
44
|
+
* O(n) rather than O(n²).
|
|
45
|
+
*
|
|
46
|
+
* A robustness check on the coordinate grain, not a replacement: a hard cell boundary can split a same-building pair
|
|
47
|
+
* into adjacent cells, so this slightly UNDER-counts relative to the radius. Coarser resolutions absorb more of that.
|
|
48
|
+
*/
|
|
49
|
+
export declare function buildOrgNameH3Grain(npiPrimary: Map<string, NPIPrimary>, npiCoord: Map<string, LatLon>, h3Res: number): TruthLabel;
|
|
50
|
+
//# sourceMappingURL=truth-grains.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"truth-grains.d.ts","sourceRoot":"","sources":["../../../tools/nppes/truth-grains.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAwB,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAGpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAE1C,OAAO,EAAW,KAAK,UAAU,EAAE,MAAM,eAAe,CAAA;AAExD;;GAEG;AACH,eAAO,MAAM,aAAa,OAAO,CAAA;AAEjC;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,YAAY,KAAK,MAAM,CAAA;AAgEtD;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAY/F;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,UAAU,CAoBjF;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,UAAU,CAuBrH;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAClC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EACnC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC7B,KAAK,EAAE,MAAM,GACX,UAAU,CAqBZ"}
|