@mailwoman/registry 10.0.0 → 10.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 +11 -14
- package/lib/address-key.ts +14 -10
- package/lib/geocode-handler.ts +7 -5
- package/lib/geojson.ts +13 -7
- package/lib/ingest.ts +70 -92
- package/lib/learned-scorer.ts +38 -44
- package/lib/map-html.ts +26 -72
- package/lib/models/crosssource-gbt-en-us.ts +9 -7
- package/lib/models/dedup-gbt-en-us.ts +9 -8
- package/lib/models/org-crosssource-gbt-en-us.ts +10 -8
- package/lib/reconcile.ts +45 -54
- package/lib/resolve.ts +187 -130
- package/lib/types.ts +35 -29
- package/out/address-key.d.ts +14 -10
- package/out/address-key.d.ts.map +1 -1
- package/out/address-key.js +14 -10
- package/out/address-key.js.map +1 -1
- package/out/geocode-handler.d.ts +6 -4
- package/out/geocode-handler.d.ts.map +1 -1
- package/out/geocode-handler.js +7 -5
- package/out/geocode-handler.js.map +1 -1
- package/out/geojson.d.ts +9 -5
- package/out/geojson.d.ts.map +1 -1
- package/out/geojson.js +13 -7
- package/out/geojson.js.map +1 -1
- package/out/ingest.d.ts +49 -76
- package/out/ingest.d.ts.map +1 -1
- package/out/ingest.js +37 -62
- package/out/ingest.js.map +1 -1
- package/out/learned-scorer.d.ts +29 -26
- package/out/learned-scorer.d.ts.map +1 -1
- package/out/learned-scorer.js +31 -39
- package/out/learned-scorer.js.map +1 -1
- package/out/map-html.d.ts +13 -32
- package/out/map-html.d.ts.map +1 -1
- package/out/map-html.js +11 -64
- package/out/map-html.js.map +1 -1
- package/out/models/crosssource-gbt-en-us.d.ts +9 -7
- package/out/models/crosssource-gbt-en-us.d.ts.map +1 -1
- package/out/models/crosssource-gbt-en-us.js +9 -7
- package/out/models/crosssource-gbt-en-us.js.map +1 -1
- package/out/models/dedup-gbt-en-us.d.ts +9 -8
- package/out/models/dedup-gbt-en-us.d.ts.map +1 -1
- package/out/models/dedup-gbt-en-us.js +9 -8
- package/out/models/dedup-gbt-en-us.js.map +1 -1
- package/out/models/org-crosssource-gbt-en-us.d.ts +10 -8
- package/out/models/org-crosssource-gbt-en-us.d.ts.map +1 -1
- package/out/models/org-crosssource-gbt-en-us.js +10 -8
- package/out/models/org-crosssource-gbt-en-us.js.map +1 -1
- package/out/reconcile.d.ts +36 -50
- package/out/reconcile.d.ts.map +1 -1
- package/out/reconcile.js +18 -42
- package/out/reconcile.js.map +1 -1
- package/out/resolve.d.ts +152 -91
- package/out/resolve.d.ts.map +1 -1
- package/out/resolve.js +67 -68
- package/out/resolve.js.map +1 -1
- package/out/tools/coverage-reconciliation.d.ts +23 -23
- package/out/tools/coverage-reconciliation.d.ts.map +1 -1
- package/out/tools/coverage-reconciliation.js +15 -26
- package/out/tools/coverage-reconciliation.js.map +1 -1
- package/out/tools/cross/dataset-correlation.d.ts +23 -27
- package/out/tools/cross/dataset-correlation.d.ts.map +1 -1
- package/out/tools/cross/dataset-correlation.js +9 -61
- package/out/tools/cross/dataset-correlation.js.map +1 -1
- package/out/tools/cross/source-threshold-sweep.d.ts +20 -26
- package/out/tools/cross/source-threshold-sweep.d.ts.map +1 -1
- package/out/tools/cross/source-threshold-sweep.js +14 -40
- package/out/tools/cross/source-threshold-sweep.js.map +1 -1
- package/out/tools/dedup-ceiling.d.ts +23 -26
- package/out/tools/dedup-ceiling.d.ts.map +1 -1
- package/out/tools/dedup-ceiling.js +22 -41
- package/out/tools/dedup-ceiling.js.map +1 -1
- package/out/tools/eval-geocoder.d.ts +25 -16
- package/out/tools/eval-geocoder.d.ts.map +1 -1
- package/out/tools/eval-geocoder.js +5 -6
- package/out/tools/eval-geocoder.js.map +1 -1
- package/out/tools/geocoder/namesake-probe.d.ts +9 -8
- package/out/tools/geocoder/namesake-probe.d.ts.map +1 -1
- package/out/tools/geocoder/namesake-probe.js +6 -7
- package/out/tools/geocoder/namesake-probe.js.map +1 -1
- package/out/tools/geocoder/vs-provided-coords.d.ts +18 -15
- package/out/tools/geocoder/vs-provided-coords.d.ts.map +1 -1
- package/out/tools/geocoder/vs-provided-coords.js +30 -27
- package/out/tools/geocoder/vs-provided-coords.js.map +1 -1
- package/out/tools/gold-set-sample.d.ts +27 -18
- package/out/tools/gold-set-sample.d.ts.map +1 -1
- package/out/tools/gold-set-sample.js +18 -22
- package/out/tools/gold-set-sample.js.map +1 -1
- package/out/tools/learned/scorer/clustering-eval.d.ts +30 -27
- package/out/tools/learned/scorer/clustering-eval.d.ts.map +1 -1
- package/out/tools/learned/scorer/clustering-eval.js +28 -38
- package/out/tools/learned/scorer/clustering-eval.js.map +1 -1
- package/out/tools/learned/scorer/crossstate-eval.d.ts +24 -18
- package/out/tools/learned/scorer/crossstate-eval.d.ts.map +1 -1
- package/out/tools/learned/scorer/crossstate-eval.js +19 -25
- package/out/tools/learned/scorer/crossstate-eval.js.map +1 -1
- package/out/tools/learned/scorer/eval.d.ts +26 -39
- package/out/tools/learned/scorer/eval.d.ts.map +1 -1
- package/out/tools/learned/scorer/eval.js +11 -71
- package/out/tools/learned/scorer/eval.js.map +1 -1
- package/out/tools/matcher-scale.d.ts +12 -17
- package/out/tools/matcher-scale.d.ts.map +1 -1
- package/out/tools/matcher-scale.js +11 -29
- package/out/tools/matcher-scale.js.map +1 -1
- package/out/tools/nppes/dedup-benchmark.d.ts +22 -41
- package/out/tools/nppes/dedup-benchmark.d.ts.map +1 -1
- package/out/tools/nppes/dedup-benchmark.js +21 -67
- package/out/tools/nppes/dedup-benchmark.js.map +1 -1
- package/out/tools/nppes/org-name.d.ts +5 -11
- package/out/tools/nppes/org-name.d.ts.map +1 -1
- package/out/tools/nppes/org-name.js +2 -9
- package/out/tools/nppes/org-name.js.map +1 -1
- package/out/tools/nppes/overmerge-packet.d.ts +15 -11
- package/out/tools/nppes/overmerge-packet.d.ts.map +1 -1
- package/out/tools/nppes/overmerge-packet.js +6 -7
- package/out/tools/nppes/overmerge-packet.js.map +1 -1
- package/out/tools/nppes/report.d.ts +17 -13
- package/out/tools/nppes/report.d.ts.map +1 -1
- package/out/tools/nppes/report.js +6 -14
- package/out/tools/nppes/report.js.map +1 -1
- package/out/tools/nppes/sample.d.ts +29 -18
- package/out/tools/nppes/sample.d.ts.map +1 -1
- package/out/tools/nppes/sample.js +24 -28
- package/out/tools/nppes/sample.js.map +1 -1
- package/out/tools/nppes/scoring.d.ts +7 -6
- package/out/tools/nppes/scoring.d.ts.map +1 -1
- package/out/tools/nppes/scoring.js +6 -5
- package/out/tools/nppes/scoring.js.map +1 -1
- package/out/tools/nppes/settings.d.ts +10 -7
- package/out/tools/nppes/settings.d.ts.map +1 -1
- package/out/tools/nppes/settings.js +16 -16
- package/out/tools/nppes/settings.js.map +1 -1
- package/out/tools/nppes/truth-grains.d.ts +36 -23
- package/out/tools/nppes/truth-grains.d.ts.map +1 -1
- package/out/tools/nppes/truth-grains.js +36 -20
- package/out/tools/nppes/truth-grains.js.map +1 -1
- package/out/tools/shared.d.ts +68 -72
- package/out/tools/shared.d.ts.map +1 -1
- package/out/tools/shared.js +50 -67
- package/out/tools/shared.js.map +1 -1
- package/out/tools/train/cross-gbt.d.ts +37 -26
- package/out/tools/train/cross-gbt.d.ts.map +1 -1
- package/out/tools/train/cross-gbt.js +14 -25
- package/out/tools/train/cross-gbt.js.map +1 -1
- package/out/tools/train/gbt.d.ts +36 -20
- package/out/tools/train/gbt.d.ts.map +1 -1
- package/out/tools/train/gbt.js +27 -31
- package/out/tools/train/gbt.js.map +1 -1
- package/out/tools/train/org-cross-gbt.d.ts +38 -24
- package/out/tools/train/org-cross-gbt.d.ts.map +1 -1
- package/out/tools/train/org-cross-gbt.js +18 -22
- package/out/tools/train/org-cross-gbt.js.map +1 -1
- package/out/tools/txhhsc-to-oarow.d.ts +14 -9
- package/out/tools/txhhsc-to-oarow.d.ts.map +1 -1
- package/out/tools/txhhsc-to-oarow.js +16 -15
- package/out/tools/txhhsc-to-oarow.js.map +1 -1
- package/out/tools/viz/browser.d.ts +6 -5
- package/out/tools/viz/browser.d.ts.map +1 -1
- package/out/tools/viz/browser.js +6 -5
- package/out/tools/viz/browser.js.map +1 -1
- package/out/tools/viz/cross-dataset-map.d.ts +7 -4
- package/out/tools/viz/cross-dataset-map.d.ts.map +1 -1
- package/out/tools/viz/cross-dataset-map.js +9 -6
- package/out/tools/viz/cross-dataset-map.js.map +1 -1
- package/out/tools/viz/geocode-first-surface.d.ts +11 -5
- package/out/tools/viz/geocode-first-surface.d.ts.map +1 -1
- package/out/tools/viz/geocode-first-surface.js +16 -11
- package/out/tools/viz/geocode-first-surface.js.map +1 -1
- package/out/tools/viz/render/map.d.ts +5 -5
- package/out/tools/viz/render/map.d.ts.map +1 -1
- package/out/tools/viz/render/map.js +6 -5
- package/out/tools/viz/render/map.js.map +1 -1
- package/out/tools/viz/{render/index.d.ts → render.d.ts} +13 -9
- package/out/tools/viz/render.d.ts.map +1 -0
- package/out/tools/viz/{render/index.js → render.js} +9 -8
- package/out/tools/viz/render.js.map +1 -0
- package/out/tools/viz/source-provenance-map.d.ts +19 -7
- package/out/tools/viz/source-provenance-map.d.ts.map +1 -1
- package/out/tools/viz/source-provenance-map.js +11 -8
- package/out/tools/viz/source-provenance-map.js.map +1 -1
- package/out/tools/viz/yardstick-figure.d.ts +2 -21
- package/out/tools/viz/yardstick-figure.d.ts.map +1 -1
- package/out/tools/viz/yardstick-figure.js +3 -39
- package/out/tools/viz/yardstick-figure.js.map +1 -1
- package/out/types.d.ts +35 -29
- package/out/types.d.ts.map +1 -1
- package/out/types.js +2 -2
- package/out/types.js.map +1 -1
- package/package.json +42 -185
- package/{lib/tools → tools}/coverage-reconciliation.ts +27 -30
- package/{lib/tools → tools}/cross/dataset-correlation.ts +35 -73
- package/{lib/tools → tools}/cross/source-threshold-sweep.ts +29 -46
- package/{lib/tools → tools}/dedup-ceiling.ts +34 -45
- package/tools/eval-geocoder.ts +77 -0
- package/{lib/tools → tools}/geocoder/namesake-probe.ts +9 -8
- package/{lib/tools → tools}/geocoder/vs-provided-coords.ts +40 -31
- package/{lib/tools → tools}/gold-set-sample.ts +35 -29
- package/{lib/tools → tools}/learned/scorer/clustering-eval.ts +49 -45
- package/{lib/tools → tools}/learned/scorer/crossstate-eval.ts +34 -30
- package/{lib/tools → tools}/learned/scorer/eval.ts +39 -78
- package/{lib/tools → tools}/matcher-scale.ts +21 -33
- package/{lib/tools → tools}/nppes/dedup-benchmark.ts +39 -83
- package/tools/nppes/org-name.ts +15 -0
- package/{lib/tools → tools}/nppes/overmerge-packet.ts +16 -12
- package/{lib/tools → tools}/nppes/report.ts +32 -25
- package/{lib/tools → tools}/nppes/sample.ts +43 -38
- package/{lib/tools → tools}/nppes/scoring.ts +7 -6
- package/{lib/tools → tools}/nppes/settings.ts +16 -16
- package/{lib/tools → tools}/nppes/truth-grains.ts +46 -26
- package/{lib/tools → tools}/shared.ts +79 -98
- package/{lib/tools → tools}/train/cross-gbt.ts +39 -34
- package/{lib/tools → tools}/train/gbt.ts +55 -41
- package/{lib/tools → tools}/train/org-cross-gbt.ts +40 -30
- package/{lib/tools → tools}/txhhsc-to-oarow.ts +24 -18
- package/{lib/tools → tools}/viz/browser.ts +6 -5
- package/{lib/tools → tools}/viz/cross-dataset-map.ts +15 -9
- package/{lib/tools → tools}/viz/geocode-first-surface.ts +29 -17
- package/{lib/tools → tools}/viz/render/map.ts +7 -6
- package/{lib/tools/viz/render/index.ts → tools/viz/render.ts} +16 -11
- package/{lib/tools → tools}/viz/source-provenance-map.ts +30 -15
- package/{lib/tools → tools}/viz/yardstick-figure.ts +6 -43
- package/lib/tools/eval-geocoder.ts +0 -67
- package/lib/tools/index.ts +0 -31
- package/lib/tools/nppes/org-name.ts +0 -23
- package/out/tools/index.d.ts +0 -31
- package/out/tools/index.d.ts.map +0 -1
- package/out/tools/index.js +0 -31
- package/out/tools/index.js.map +0 -1
- package/out/tools/viz/render/index.d.ts.map +0 -1
- package/out/tools/viz/render/index.js.map +0 -1
|
@@ -4,34 +4,46 @@
|
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
6
|
* Sample `address_point.source` rows from a state database and render them by source in MapLibre.
|
|
7
|
-
* The output requires an
|
|
7
|
+
* The output requires an http origin because the tile server does not serve `file:` origins.
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
10
|
* Options for {@linkcode sourceProvenanceMap}.
|
|
11
11
|
*/
|
|
12
12
|
export interface SourceProvenanceMapOptions {
|
|
13
13
|
/**
|
|
14
|
-
* State (lowercase postal).
|
|
14
|
+
* State (lowercase postal).
|
|
15
|
+
*
|
|
16
|
+
* @defaultValue `"ny"`
|
|
15
17
|
*/
|
|
16
18
|
state?: string;
|
|
17
19
|
/**
|
|
18
|
-
* Address-point DB path.
|
|
20
|
+
* Address-point DB path.
|
|
21
|
+
*
|
|
22
|
+
* @defaultValue `$MAILWOMAN_DATA_ROOT/db/address-points/address-points-us-<state>.db`
|
|
19
23
|
*/
|
|
20
24
|
db?: string;
|
|
21
25
|
/**
|
|
22
|
-
* Output
|
|
26
|
+
* Output html path.
|
|
27
|
+
*
|
|
28
|
+
* @defaultValue `/tmp/source-provenance.html`
|
|
23
29
|
*/
|
|
24
30
|
outHTML?: string;
|
|
25
31
|
/**
|
|
26
|
-
* Keep ~1/N of NAD points.
|
|
32
|
+
* Keep ~1/N of NAD points.
|
|
33
|
+
*
|
|
34
|
+
* @defaultValue `700`
|
|
27
35
|
*/
|
|
28
36
|
nadMod?: number;
|
|
29
37
|
/**
|
|
30
|
-
* Keep ~1/N of OpenAddresses points.
|
|
38
|
+
* Keep ~1/N of OpenAddresses points.
|
|
39
|
+
*
|
|
40
|
+
* @defaultValue `120`
|
|
31
41
|
*/
|
|
32
42
|
oaMod?: number;
|
|
33
43
|
/**
|
|
34
|
-
* Per-source marker cap.
|
|
44
|
+
* Per-source marker cap.
|
|
45
|
+
*
|
|
46
|
+
* @defaultValue `7000`
|
|
35
47
|
*/
|
|
36
48
|
cap?: number;
|
|
37
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-provenance-map.d.ts","sourceRoot":"","sources":["../../../
|
|
1
|
+
{"version":3,"file":"source-provenance-map.d.ts","sourceRoot":"","sources":["../../../tools/viz/source-provenance-map.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAYH;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IACX;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;CACZ;AAwBD;;GAEG;AACH,wBAAsB,mBAAmB,CACxC,OAAO,GAAE,0BAA+B,EACxC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAgE9C"}
|
|
@@ -4,16 +4,18 @@
|
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
6
|
* Sample `address_point.source` rows from a state database and render them by source in MapLibre.
|
|
7
|
-
* The output requires an
|
|
7
|
+
* The output requires an http origin because the tile server does not serve `file:` origins.
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
9
|
+
import { tempRootPath } from "@mailwoman/core/data-root";
|
|
10
10
|
import { writeLocalFile } from "@mailwoman/core/fs/writers";
|
|
11
11
|
import { isPresent } from "@mailwoman/core/objects";
|
|
12
|
+
import { addressPointDatabasePath } from "@mailwoman/resolver-wof-sqlite/paths";
|
|
12
13
|
import { DatabaseClient } from "@mailwoman/sqlite/client";
|
|
13
14
|
import { toMapHTML } from "#index";
|
|
14
|
-
// Collapse the raw `source` string into a human, mappable category.
|
|
15
|
-
// "overture:NAD" or "overture:OpenAddresses/NY/NYC Open Data"
|
|
16
|
-
//
|
|
15
|
+
// Collapse the raw `source` string into a human, mappable category.
|
|
16
|
+
// The address-point DB stores e.g. "overture:NAD" or "overture:OpenAddresses/NY/NYC Open Data".
|
|
17
|
+
// The suffix gives the real upstream publisher.
|
|
18
|
+
// Color features by that value (the "overture:" prefix is just the theme it arrived in).
|
|
17
19
|
function categorize(source) {
|
|
18
20
|
if (source === "overture:NAD")
|
|
19
21
|
return { bucket: "National Address Database", publisher: "NAD (federal)" };
|
|
@@ -28,14 +30,15 @@ function categorize(source) {
|
|
|
28
30
|
*/
|
|
29
31
|
export async function sourceProvenanceMap(options = {}, report) {
|
|
30
32
|
const STATE = (options.state || "ny").toLowerCase();
|
|
31
|
-
const DB = options.db ||
|
|
33
|
+
const DB = options.db || addressPointDatabasePath(`address-points-us-${STATE}.db`);
|
|
32
34
|
const OUT = options.outHTML || tempRootPath("source-provenance.html");
|
|
33
35
|
const NAD_MOD = options.nadMod ?? 700; // keep ~1/700 of NAD points
|
|
34
36
|
const OA_MOD = options.oaMod ?? 120; // keep ~1/120 of OpenAddresses points
|
|
35
37
|
const CAP = options.cap ?? 7000; // per-source marker cap
|
|
36
38
|
using db = new DatabaseClient(DB, { readOnly: true });
|
|
37
|
-
// Two stratified samples so the smaller source (OpenAddresses, ~1/6 of NY) stays visible
|
|
38
|
-
// abs(random()) % mod == 0 keeps a spatially-uniform ~1/mod fraction
|
|
39
|
+
// Two stratified samples so the smaller source (OpenAddresses, ~1/6 of NY) stays visible
|
|
40
|
+
// next to NAD. abs(random()) % mod == 0 keeps a spatially-uniform ~1/mod fraction.
|
|
41
|
+
// Limit caps the marker count.
|
|
39
42
|
const sample = (where, mod) => db
|
|
40
43
|
.prepare(`SELECT lat, lon, source, number, street_raw FROM address_point
|
|
41
44
|
WHERE ${where} AND lat IS NOT NULL AND lon IS NOT NULL AND abs(random()) % ${mod} = 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-provenance-map.js","sourceRoot":"","sources":["../../../
|
|
1
|
+
{"version":3,"file":"source-provenance-map.js","sourceRoot":"","sources":["../../../tools/viz/source-provenance-map.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAA;AAE/E,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAEzD,OAAO,EAAuB,SAAS,EAAE,MAAM,QAAQ,CAAA;AA4CvD,oEAAoE;AACpE,gGAAgG;AAChG,gDAAgD;AAChD,yFAAyF;AACzF,SAAS,UAAU,CAAC,MAAc;IACjC,IAAI,MAAM,KAAK,cAAc;QAAE,OAAO,EAAE,MAAM,EAAE,2BAA2B,EAAE,SAAS,EAAE,eAAe,EAAE,CAAA;IAEzG,IAAI,MAAM,CAAC,UAAU,CAAC,wBAAwB,CAAC,EAAE,CAAC;QACjD,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,eAAe,CAAA;QAE7D,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,mBAAmB,SAAS,EAAE,EAAE,CAAA;IAC9E,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,CAAA;AAC7C,CAAC;AAQD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACxC,OAAO,GAA+B,EAAE,EACxC,MAA+B;IAE/B,MAAM,KAAK,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,WAAW,EAAE,CAAA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,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAA;AACjD,CAAC"}
|
|
@@ -2,33 +2,14 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* The yardstick figure — "the dedup F1 climbs as the entity-truth gets honest."
|
|
7
|
-
*
|
|
8
|
-
* The #625 finding, made visual: the matcher's MEASURED dedup quality depends almost entirely on
|
|
9
|
-
* which ruler you grade it against, not on the model. NPI-as-truth OVER-SEGMENTS (one org holds
|
|
10
|
-
* many NPIs), so the matcher's correct co-located same-org merges are scored as errors. Grade the
|
|
11
|
-
* IDENTICAL clusters against a gold-set-validated org-name truth and the F1 climbs — the ruler
|
|
12
|
-
* ceasing to charge for correct merges, not the model changing — peaking when the ruler keys on
|
|
13
|
-
* the geocoded BUILDING (the geocode-first coordinate) rather than the address string (+14.5pp
|
|
14
|
-
* NPI → coord).
|
|
15
|
-
*
|
|
16
|
-
* A slope chart over four rulers (NPI → site → org-name → org-name-coord) for the shipped GBT
|
|
17
|
-
* scorer and the FS baseline. Numbers are the committed measurement in
|
|
18
|
-
* `docs/records/evals/matcher-dedup/2026-06-16-dedup-dual-level-benchmark.md` (1000 TX NPIs → 2757 records).
|
|
19
|
-
*
|
|
20
|
-
* Emits a self-contained SVG (the docs' committed-chart-asset convention — see
|
|
21
|
-
* `docs/records/evals/charts/*.svg`), no browser required.
|
|
22
|
-
*
|
|
23
|
-
* Run: `mailwoman registry viz yardstick-figure
|
|
24
|
-
* [--out-svg docs/records/evals/charts/dedup-yardstick.svg]`
|
|
25
5
|
*/
|
|
26
6
|
/**
|
|
27
7
|
* Options for {@linkcode yardstickFigure}.
|
|
28
8
|
*/
|
|
29
9
|
export interface YardstickFigureOptions {
|
|
30
10
|
/**
|
|
31
|
-
*
|
|
11
|
+
* Sets the output SVG path relative to the working directory, defaulting
|
|
12
|
+
* to `docs/records/evals/charts/dedup-yardstick.svg`.
|
|
32
13
|
*/
|
|
33
14
|
outSVG?: string;
|
|
34
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yardstick-figure.d.ts","sourceRoot":"","sources":["../../../
|
|
1
|
+
{"version":3,"file":"yardstick-figure.d.ts","sourceRoot":"","sources":["../../../tools/viz/yardstick-figure.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CACf;AAmDD;;GAEG;AACH,wBAAsB,eAAe,CACpC,OAAO,GAAE,sBAA2B,EACpC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAyH7B"}
|
|
@@ -2,26 +2,6 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* The yardstick figure — "the dedup F1 climbs as the entity-truth gets honest."
|
|
7
|
-
*
|
|
8
|
-
* The #625 finding, made visual: the matcher's MEASURED dedup quality depends almost entirely on
|
|
9
|
-
* which ruler you grade it against, not on the model. NPI-as-truth OVER-SEGMENTS (one org holds
|
|
10
|
-
* many NPIs), so the matcher's correct co-located same-org merges are scored as errors. Grade the
|
|
11
|
-
* IDENTICAL clusters against a gold-set-validated org-name truth and the F1 climbs — the ruler
|
|
12
|
-
* ceasing to charge for correct merges, not the model changing — peaking when the ruler keys on
|
|
13
|
-
* the geocoded BUILDING (the geocode-first coordinate) rather than the address string (+14.5pp
|
|
14
|
-
* NPI → coord).
|
|
15
|
-
*
|
|
16
|
-
* A slope chart over four rulers (NPI → site → org-name → org-name-coord) for the shipped GBT
|
|
17
|
-
* scorer and the FS baseline. Numbers are the committed measurement in
|
|
18
|
-
* `docs/records/evals/matcher-dedup/2026-06-16-dedup-dual-level-benchmark.md` (1000 TX NPIs → 2757 records).
|
|
19
|
-
*
|
|
20
|
-
* Emits a self-contained SVG (the docs' committed-chart-asset convention — see
|
|
21
|
-
* `docs/records/evals/charts/*.svg`), no browser required.
|
|
22
|
-
*
|
|
23
|
-
* Run: `mailwoman registry viz yardstick-figure
|
|
24
|
-
* [--out-svg docs/records/evals/charts/dedup-yardstick.svg]`
|
|
25
5
|
*/
|
|
26
6
|
import { writeLocalTextFile } from "@mailwoman/core/fs/writers";
|
|
27
7
|
import { escapeHTML } from "@mailwoman/core/strings/escape";
|
|
@@ -36,21 +16,14 @@ const GRAINS = [
|
|
|
36
16
|
note: "collapse by geocoded\nBUILDING (geocode-first key)",
|
|
37
17
|
},
|
|
38
18
|
];
|
|
39
|
-
/**
|
|
40
|
-
* F1 per (model, grain), in %.
|
|
41
|
-
*/
|
|
42
19
|
const F1 = {
|
|
43
|
-
GBT: [53.6, 55.3, 60.7, 68.1],
|
|
44
|
-
FS: [45.1, 42.7, 52.3, 60.3],
|
|
20
|
+
GBT: [53.6, 55.3, 60.7, 68.1],
|
|
21
|
+
FS: [45.1, 42.7, 52.3, 60.3],
|
|
45
22
|
};
|
|
46
|
-
/**
|
|
47
|
-
* Over-merged cluster counts per (model, grain) — the genuine-precision story for GBT.
|
|
48
|
-
*/
|
|
49
23
|
const OVERMERGE = {
|
|
50
24
|
GBT: [109, 208, 92, 76],
|
|
51
25
|
FS: [144, 253, 129, 114],
|
|
52
26
|
};
|
|
53
|
-
// ── Geometry. ───────────────────────────────────────────────────────────────────────────────────
|
|
54
27
|
const W = 760;
|
|
55
28
|
const H = 430;
|
|
56
29
|
const PAD = { top: 64, right: 168, bottom: 92, left: 64 };
|
|
@@ -75,28 +48,24 @@ export async function yardstickFigure(options = {}, report) {
|
|
|
75
48
|
const parts = [];
|
|
76
49
|
const push = (s) => parts.push(s);
|
|
77
50
|
push(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${W} ${H}" width="${W}" height="${H}" font-family="ui-sans-serif, system-ui, sans-serif" font-size="11"><rect width="${W}" height="${H}" fill="white"/>`);
|
|
78
|
-
// Title + subtitle.
|
|
79
51
|
push(`<text x="${W / 2}" y="24" text-anchor="middle" font-size="15" font-weight="600">The dedup F1 climbs as the entity-truth gets honest</text>`);
|
|
80
52
|
push(`<text x="${W / 2}" y="42" text-anchor="middle" font-size="11.5" fill="#555">Identical matcher output (the same clusters) graded against four rulers — 1000 TX NPIs → 2757 records, NPI held out</text>`);
|
|
81
|
-
// Y gridlines + labels.
|
|
82
53
|
for (let v = Y_MIN; v <= Y_MAX; v += 5) {
|
|
83
54
|
const y = yFor(v);
|
|
84
55
|
push(`<line x1="${plotL}" y1="${y.toFixed(1)}" x2="${plotR}" y2="${y.toFixed(1)}" stroke="#e5e7eb" stroke-width="1"/>`);
|
|
85
56
|
push(`<text x="${plotL - 8}" y="${(y + 3).toFixed(1)}" text-anchor="end" fill="#374151">${v}%</text>`);
|
|
86
57
|
}
|
|
87
58
|
push(`<text transform="translate(20, ${(plotT + plotB) / 2}) rotate(-90)" text-anchor="middle" font-size="12" fill="#374151">entity-resolution F1</text>`);
|
|
88
|
-
// X category ticks + labels + the class-count + note strip.
|
|
89
59
|
GRAINS.forEach((g, i) => {
|
|
90
60
|
const x = xFor(i);
|
|
91
61
|
push(`<line x1="${x.toFixed(1)}" y1="${plotT}" x2="${x.toFixed(1)}" y2="${plotB}" stroke="#f1f1f1" stroke-width="1"/>`);
|
|
92
62
|
push(`<text x="${x.toFixed(1)}" y="${plotB + 20}" text-anchor="middle" font-size="12.5" font-weight="600">${esc(g.label)}</text>`);
|
|
93
63
|
push(`<text x="${x.toFixed(1)}" y="${plotB + 36}" text-anchor="middle" font-size="10" fill="#6b7280">${g.classes} classes</text>`);
|
|
94
|
-
// oxlint-disable-next-line mailwoman/prefer-spliterator -- `g.note` is a literal label from the
|
|
64
|
+
// oxlint-disable-next-line mailwoman/prefer-spliterator -- `g.note` is a literal label from the models table rather than a file.
|
|
95
65
|
g.note.split("\n").forEach((line, k) => {
|
|
96
66
|
push(`<text x="${x.toFixed(1)}" y="${plotB + 50 + k * 12}" text-anchor="middle" font-size="9" fill="#9ca3af">${esc(line)}</text>`);
|
|
97
67
|
});
|
|
98
68
|
});
|
|
99
|
-
// Model slope lines + points.
|
|
100
69
|
for (const m of MODELS) {
|
|
101
70
|
const f1s = F1[m.key];
|
|
102
71
|
const pts = f1s.map((f, i) => `${xFor(i).toFixed(1)},${yFor(f).toFixed(1)}`).join(" ");
|
|
@@ -105,12 +74,10 @@ export async function yardstickFigure(options = {}, report) {
|
|
|
105
74
|
const x = xFor(i);
|
|
106
75
|
const y = yFor(f);
|
|
107
76
|
push(`<circle cx="${x.toFixed(1)}" cy="${y.toFixed(1)}" r="${m.key === "GBT" ? 5 : 4}" fill="${m.color}"/>`);
|
|
108
|
-
// value label: above for GBT, below for FS, to avoid collision
|
|
109
77
|
const dy = m.key === "GBT" ? -10 : 16;
|
|
110
78
|
push(`<text x="${x.toFixed(1)}" y="${(y + dy).toFixed(1)}" text-anchor="middle" font-size="11" font-weight="${m.key === "GBT" ? 700 : 400}" fill="${m.color}">${f.toFixed(1)}</text>`);
|
|
111
79
|
});
|
|
112
80
|
}
|
|
113
|
-
// Legend (top-right, in the right margin).
|
|
114
81
|
const lx = plotR + 16;
|
|
115
82
|
let ly = plotT + 6;
|
|
116
83
|
for (const m of MODELS) {
|
|
@@ -118,7 +85,6 @@ export async function yardstickFigure(options = {}, report) {
|
|
|
118
85
|
push(`<text x="${lx + 28}" y="${ly + 3.5}" font-size="10.5" fill="#374151">${esc(m.label)}</text>`);
|
|
119
86
|
ly += 18;
|
|
120
87
|
}
|
|
121
|
-
// The headline callout — the full climb for the shipped model, ending at the geocode-first key.
|
|
122
88
|
const gCoord = yFor(F1.GBT[3]);
|
|
123
89
|
const gNPI = yFor(F1.GBT[0]);
|
|
124
90
|
push(`<g font-size="10.5">` +
|
|
@@ -128,9 +94,7 @@ export async function yardstickFigure(options = {}, report) {
|
|
|
128
94
|
`<text x="${lx}" y="${ly + 64}" fill="#555">over-merge 109 → 76,</text>` +
|
|
129
95
|
`<text x="${lx}" y="${ly + 77}" fill="#555">precision 43.7% → 64.6%.</text>` +
|
|
130
96
|
`</g>`);
|
|
131
|
-
// Bracket the GBT climb on the right edge of the plot (NPI → coord, the full honest range).
|
|
132
97
|
push(`<path d="M ${(plotR - 4).toFixed(1)} ${gNPI.toFixed(1)} L ${(plotR + 2).toFixed(1)} ${gNPI.toFixed(1)} L ${(plotR + 2).toFixed(1)} ${gCoord.toFixed(1)} L ${(plotR - 4).toFixed(1)} ${gCoord.toFixed(1)}" fill="none" stroke="#3578e5" stroke-width="1" opacity="0.5"/>`);
|
|
133
|
-
// Footer caveat — the gold-set anchor.
|
|
134
98
|
push(`<text x="${plotL}" y="${H - 10}" font-size="9.5" fill="#9ca3af">Gold set (2026-06-16-dedup-gold-set-tx120): 120/120 hard co-located pairs = same org, 0 genuine over-merges. The coordinate (geocode-first building key) is the tightest honest ruler; NPI charges correct same-org merges as errors.</text>`);
|
|
135
99
|
push(`</svg>`);
|
|
136
100
|
await writeLocalTextFile(parts.join(""), OUT);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yardstick-figure.js","sourceRoot":"","sources":["../../../
|
|
1
|
+
{"version":3,"file":"yardstick-figure.js","sourceRoot":"","sources":["../../../tools/viz/yardstick-figure.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAoB3D,MAAM,MAAM,GAAY;IACvB,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,mDAAmD,EAAE;IACtG,EAAE,GAAG,EAAE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AAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IAEvD,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,CAAA;AACvB,CAAC"}
|
package/out/types.d.ts
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* The application's data shapes — the messy record that goes in
|
|
6
|
+
* The application's data shapes — the messy record that goes in and the canonical entity that
|
|
7
7
|
* comes out. Plain interfaces over the `@mailwoman/record` types.
|
|
8
8
|
*/
|
|
9
|
-
import type {
|
|
9
|
+
import type { ResolutionTier } from "@mailwoman/annotations/geo";
|
|
10
|
+
import type { OrganizationName, PersonName, PostalAddress } from "@mailwoman/record";
|
|
10
11
|
/**
|
|
11
12
|
* A single source record: one row of a messy contact/organization dataset, after normalization.
|
|
12
13
|
*/
|
|
@@ -18,32 +19,35 @@ export interface SourceRecord {
|
|
|
18
19
|
/**
|
|
19
20
|
* Provenance: which file / dataset this came from.
|
|
20
21
|
*/
|
|
21
|
-
source
|
|
22
|
+
source: string | null;
|
|
22
23
|
/**
|
|
23
24
|
* Parsed person name, when the record is a contact.
|
|
24
25
|
*/
|
|
25
|
-
name
|
|
26
|
+
name: PersonName | null;
|
|
26
27
|
/**
|
|
27
28
|
* Canonicalized organization name, when the record is an org.
|
|
28
29
|
*/
|
|
29
|
-
organization
|
|
30
|
+
organization: OrganizationName | null;
|
|
30
31
|
/**
|
|
31
32
|
* The address, normalized + (ideally) geocoded.
|
|
32
33
|
*/
|
|
33
|
-
address
|
|
34
|
-
phone
|
|
35
|
-
email
|
|
34
|
+
address: PostalAddress | null;
|
|
35
|
+
phone: string | null;
|
|
36
|
+
email: string | null;
|
|
36
37
|
/**
|
|
37
|
-
* Additional secondary-identifier fields, normalized
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
38
|
+
* Additional secondary-identifier fields, normalized.
|
|
39
|
+
*
|
|
40
|
+
* Anything that helps tell two records apart or confirm they're the same beyond
|
|
41
|
+
* name/org/address/phone (an authorized-official name, a provider taxonomy, a license number…).
|
|
42
|
+
*
|
|
43
|
+
* Used as extra comparisons + corroborators when the model is built with matching `discriminators`.
|
|
44
|
+
* Keyed by a stable field name the model references.
|
|
41
45
|
*/
|
|
42
|
-
attributes
|
|
46
|
+
attributes: Record<string, string> | null;
|
|
43
47
|
/**
|
|
44
48
|
* The original row, verbatim, for audit.
|
|
45
49
|
*/
|
|
46
|
-
raw
|
|
50
|
+
raw: Record<string, string> | null;
|
|
47
51
|
}
|
|
48
52
|
/**
|
|
49
53
|
* A resolved canonical entity: a cluster of source records judged to be the same real-world thing.
|
|
@@ -64,10 +68,10 @@ export interface ResolvedEntity {
|
|
|
64
68
|
/**
|
|
65
69
|
* The entity's location, from the representative's geocode.
|
|
66
70
|
*/
|
|
67
|
-
coordinate
|
|
71
|
+
coordinate: {
|
|
68
72
|
latitude: number;
|
|
69
73
|
longitude: number;
|
|
70
|
-
};
|
|
74
|
+
} | null;
|
|
71
75
|
/**
|
|
72
76
|
* Weakest within-cluster link weight in bits (how tightly it holds together); `null` for a singleton.
|
|
73
77
|
*/
|
|
@@ -79,24 +83,26 @@ export interface ResolvedEntity {
|
|
|
79
83
|
export type ReconciliationBucket = "enrolled" | "eligible-not-enrolled" | "funded-not-eligible";
|
|
80
84
|
export interface EntityGeoData {
|
|
81
85
|
entityID: string;
|
|
82
|
-
sourceIDs
|
|
83
|
-
recordCount
|
|
84
|
-
cohesion
|
|
86
|
+
sourceIDs: string[];
|
|
87
|
+
recordCount: number;
|
|
88
|
+
cohesion: number | null;
|
|
85
89
|
sources: string[];
|
|
86
90
|
name: string | null;
|
|
87
|
-
organization
|
|
88
|
-
address
|
|
89
|
-
geocodeTier
|
|
90
|
-
bucket
|
|
91
|
+
organization: string | null;
|
|
92
|
+
address: string | null;
|
|
93
|
+
geocodeTier: ResolutionTier | null;
|
|
94
|
+
bucket: ReconciliationBucket | null;
|
|
91
95
|
}
|
|
92
96
|
/**
|
|
93
|
-
* Feature properties the map renderer consumes — {@link EntityGeoData} with every
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
97
|
+
* Feature properties the map renderer consumes — {@link EntityGeoData} with every
|
|
98
|
+
* field optional, plus an unconstrained `bucket`.
|
|
99
|
+
*
|
|
100
|
+
* The renderer assigns a color per distinct bucket value in first-seen order and builds
|
|
101
|
+
* its legend from that set, so a bucket is any categorical label rather than only a
|
|
102
|
+
* {@link ReconciliationBucket}; and a collection assembled from something other than resolved
|
|
103
|
+
* entities (raw address points, links read back from a file) have no entity id or display name.
|
|
98
104
|
*/
|
|
99
105
|
export type MapFeatureData = Partial<Omit<EntityGeoData, "bucket">> & {
|
|
100
|
-
bucket?: string;
|
|
106
|
+
bucket?: string | null;
|
|
101
107
|
};
|
|
102
108
|
//# sourceMappingURL=types.d.ts.map
|
package/out/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEpF;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB;;OAEG;IACH,IAAI,EAAE,UAAU,GAAG,IAAI,CAAA;IACvB;;OAEG;IACH,YAAY,EAAE,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MAAM,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAA"}
|
package/out/types.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* The application's data shapes — the messy record that goes in
|
|
6
|
+
* The application's data shapes — the messy record that goes in and the canonical entity that
|
|
7
7
|
* comes out. Plain interfaces over the `@mailwoman/record` types.
|
|
8
8
|
*/
|
|
9
9
|
export {};
|
|
10
|
-
|
|
10
|
+
// #endregion
|
|
11
11
|
//# sourceMappingURL=types.js.map
|
package/out/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;;AAsGH,aAAa"}
|