@mailwoman/registry 10.0.0 → 10.1.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 +10 -10
- package/lib/address-key.ts +14 -10
- package/lib/geocode-handler.ts +6 -4
- package/lib/geojson.ts +11 -6
- package/lib/ingest.ts +57 -83
- package/lib/learned-scorer.ts +38 -44
- package/lib/map-html.ts +24 -70
- 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 +43 -53
- package/lib/resolve.ts +180 -124
- package/lib/types.ts +18 -12
- 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 +6 -4
- 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 +11 -6
- package/out/geojson.js.map +1 -1
- package/out/ingest.d.ts +46 -75
- package/out/ingest.d.ts.map +1 -1
- package/out/ingest.js +27 -54
- 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 +9 -62
- 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 +35 -50
- package/out/reconcile.d.ts.map +1 -1
- package/out/reconcile.js +17 -41
- package/out/reconcile.js.map +1 -1
- package/out/resolve.d.ts +150 -90
- package/out/resolve.d.ts.map +1 -1
- package/out/resolve.js +62 -63
- 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 +20 -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 +22 -15
- 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 +22 -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 +21 -41
- package/out/tools/nppes/dedup-benchmark.d.ts.map +1 -1
- package/out/tools/nppes/dedup-benchmark.js +20 -66
- package/out/tools/nppes/dedup-benchmark.js.map +1 -1
- package/out/tools/nppes/org-name.d.ts +5 -4
- package/out/tools/nppes/org-name.d.ts.map +1 -1
- package/out/tools/nppes/org-name.js +2 -2
- 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 +5 -6
- 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 +28 -17
- package/out/tools/nppes/sample.d.ts.map +1 -1
- package/out/tools/nppes/sample.js +23 -26
- 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 +63 -59
- package/out/tools/shared.d.ts.map +1 -1
- package/out/tools/shared.js +49 -66
- package/out/tools/shared.js.map +1 -1
- package/out/tools/train/cross-gbt.d.ts +36 -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 +37 -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 +10 -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 +17 -11
- package/out/types.d.ts.map +1 -1
- package/out/types.js +2 -2
- package/out/types.js.map +1 -1
- package/package.json +41 -184
- package/{lib/tools → tools}/coverage-reconciliation.ts +27 -30
- package/{lib/tools → tools}/cross/dataset-correlation.ts +31 -72
- 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 +74 -0
- package/{lib/tools → tools}/geocoder/namesake-probe.ts +9 -8
- package/{lib/tools → tools}/geocoder/vs-provided-coords.ts +39 -30
- 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 +35 -78
- package/{lib/tools → tools}/matcher-scale.ts +21 -33
- package/{lib/tools → tools}/nppes/dedup-benchmark.ts +37 -82
- package/{lib/tools → tools}/nppes/org-name.ts +5 -4
- package/{lib/tools → tools}/nppes/overmerge-packet.ts +15 -11
- package/{lib/tools → tools}/nppes/report.ts +32 -25
- package/{lib/tools → tools}/nppes/sample.ts +41 -36
- 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 +73 -83
- package/{lib/tools → tools}/train/cross-gbt.ts +38 -34
- package/{lib/tools → tools}/train/gbt.ts +55 -41
- package/{lib/tools → tools}/train/org-cross-gbt.ts +39 -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 +28 -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/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
package/out/tools/train/gbt.d.ts
CHANGED
|
@@ -3,16 +3,14 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* benchmark
|
|
8
|
-
*
|
|
9
|
-
* `createMatchFeaturizer
|
|
10
|
-
*
|
|
11
|
-
* (`registry/models/dedup-gbt-en-us.ts`) that ships in the package.
|
|
6
|
+
* Trains the production learned-scorer model. `buildNPPESSample` creates the same NPI-keyed records used by
|
|
7
|
+
* the dedup benchmark and clustering A/B. The sample uses the real registry and includes name drift plus address variation.
|
|
8
|
+
* The trainer geocodes records and groups them into candidate pairs. It featurizes each pair with
|
|
9
|
+
* `createMatchFeaturizer`. It labels pairs by NPI and fits a gradient-boosted tree model.
|
|
10
|
+
* It writes the model to the committed package module `registry/models/dedup-gbt-en-us.ts`.
|
|
12
11
|
*
|
|
13
|
-
* Unlike the eval, this trains on
|
|
14
|
-
* eval's job
|
|
15
|
-
* then re-measures generalization against the FS baseline.
|
|
12
|
+
* Unlike the eval, this trains on all sampled NPIs with no held-out split, since the held-out F1
|
|
13
|
+
* is the eval's job.
|
|
16
14
|
*
|
|
17
15
|
* Run: `mailwoman registry train-scorer gbt [--state TX] [--npis 3000] [--wof <admin.db>]
|
|
18
16
|
* [--data-root <dir>] [--out registry/models/dedup-gbt-en-us.ts]`
|
|
@@ -23,42 +21,60 @@ import type { EvalGeocoderFactory } from "#tools/eval-geocoder";
|
|
|
23
21
|
*/
|
|
24
22
|
export interface TrainDedupGBTOptions {
|
|
25
23
|
/**
|
|
26
|
-
* The injected geocoder factory
|
|
24
|
+
* The injected geocoder factory.
|
|
25
|
+
*
|
|
26
|
+
* The command wires `mailwoman/geocode-core`, as `./eval-geocoder.ts` does.
|
|
27
27
|
*/
|
|
28
28
|
createGeocoder: EvalGeocoderFactory;
|
|
29
29
|
/**
|
|
30
|
-
* Record-matcher sources directory.
|
|
30
|
+
* Record-matcher sources directory.
|
|
31
|
+
*
|
|
32
|
+
* Default `$MAILWOMAN_DATA_ROOT/record-matcher/sources`.
|
|
31
33
|
*/
|
|
32
34
|
sources?: string;
|
|
33
35
|
/**
|
|
34
|
-
* State filter.
|
|
36
|
+
* State filter.
|
|
37
|
+
*
|
|
38
|
+
* Default TX.
|
|
35
39
|
*/
|
|
36
40
|
state?: string;
|
|
37
41
|
/**
|
|
38
|
-
* NPIs sampled.
|
|
42
|
+
* NPIs sampled.
|
|
43
|
+
*
|
|
44
|
+
* Default 3000.
|
|
39
45
|
*/
|
|
40
46
|
npis?: number;
|
|
41
47
|
/**
|
|
42
|
-
* Output TS module path.
|
|
48
|
+
* Output TS module path.
|
|
49
|
+
*
|
|
50
|
+
* Default `registry/models/dedup-gbt-en-us.ts`.
|
|
43
51
|
*/
|
|
44
52
|
out?: string;
|
|
45
53
|
/**
|
|
46
|
-
* Locale recorded in the model meta (the command's factory loads the matching weights).
|
|
54
|
+
* Locale recorded in the model meta (the command's factory loads the matching weights).
|
|
55
|
+
*
|
|
56
|
+
* Default en-US.
|
|
47
57
|
*/
|
|
48
58
|
locale?: string;
|
|
49
59
|
/**
|
|
50
|
-
* Cost-sensitive training
|
|
51
|
-
*
|
|
52
|
-
*
|
|
60
|
+
* Cost-sensitive training: up-weight the negative (distinct-pair) class by this factor
|
|
61
|
+
* so the model is more conservative about merging.
|
|
62
|
+
*
|
|
63
|
+
* It trades recall for precision to reduce over-merge.
|
|
64
|
+
* `1` is the symmetric class-balanced default.
|
|
65
|
+
*
|
|
66
|
+
* A value above 1 penalizes a false merge more than a missed merge.
|
|
53
67
|
*/
|
|
54
68
|
cost?: number;
|
|
55
69
|
/**
|
|
56
|
-
*
|
|
70
|
+
* The training date stored in the metadata (overridable for reproducible commits).
|
|
71
|
+
*
|
|
72
|
+
* Default today.
|
|
57
73
|
*/
|
|
58
74
|
date?: string;
|
|
59
75
|
}
|
|
60
76
|
/**
|
|
61
|
-
* Train
|
|
77
|
+
* Train and emit the production dedup GBT.
|
|
62
78
|
*/
|
|
63
79
|
export declare function trainDedupGBT(options: TrainDedupGBTOptions, report?: (line: string) => void): Promise<{
|
|
64
80
|
out: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gbt.d.ts","sourceRoot":"","sources":["../../../
|
|
1
|
+
{"version":3,"file":"gbt.d.ts","sourceRoot":"","sources":["../../../tools/train/gbt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAmBH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAW/D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;;OAIG;IACH,cAAc,EAAE,mBAAmB,CAAA;IACnC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACb;AAED;;GAEG;AACH,wBAAsB,aAAa,CAClC,OAAO,EAAE,oBAAoB,EAC7B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,oBAAoB,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAsJ1F"}
|
package/out/tools/train/gbt.js
CHANGED
|
@@ -3,22 +3,21 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* benchmark
|
|
8
|
-
*
|
|
9
|
-
* `createMatchFeaturizer
|
|
10
|
-
*
|
|
11
|
-
* (`registry/models/dedup-gbt-en-us.ts`) that ships in the package.
|
|
6
|
+
* Trains the production learned-scorer model. `buildNPPESSample` creates the same NPI-keyed records used by
|
|
7
|
+
* the dedup benchmark and clustering A/B. The sample uses the real registry and includes name drift plus address variation.
|
|
8
|
+
* The trainer geocodes records and groups them into candidate pairs. It featurizes each pair with
|
|
9
|
+
* `createMatchFeaturizer`. It labels pairs by NPI and fits a gradient-boosted tree model.
|
|
10
|
+
* It writes the model to the committed package module `registry/models/dedup-gbt-en-us.ts`.
|
|
12
11
|
*
|
|
13
|
-
* Unlike the eval, this trains on
|
|
14
|
-
* eval's job
|
|
15
|
-
* then re-measures generalization against the FS baseline.
|
|
12
|
+
* Unlike the eval, this trains on all sampled NPIs with no held-out split, since the held-out F1
|
|
13
|
+
* is the eval's job.
|
|
16
14
|
*
|
|
17
15
|
* Run: `mailwoman registry train-scorer gbt [--state TX] [--npis 3000] [--wof <admin.db>]
|
|
18
16
|
* [--data-root <dir>] [--out registry/models/dedup-gbt-en-us.ts]`
|
|
19
17
|
*/
|
|
20
18
|
import { dataRootPath } from "@mailwoman/core/data-root";
|
|
21
19
|
import { makeDirectories, writeLocalFile } from "@mailwoman/core/fs/writers";
|
|
20
|
+
import { prettyJSON, stringifyJSON } from "@mailwoman/core/json";
|
|
22
21
|
import { makeLcg } from "@mailwoman/core/random";
|
|
23
22
|
import { isoDate } from "@mailwoman/core/utils";
|
|
24
23
|
import { block, gbtScore, trainGBT } from "@mailwoman/match";
|
|
@@ -28,11 +27,12 @@ import { buildNPPESSample } from "#tools/nppes/sample";
|
|
|
28
27
|
import { scoreEntities } from "#tools/nppes/scoring";
|
|
29
28
|
import { stateOption, uniqueQuantiles } from "#tools/shared";
|
|
30
29
|
/**
|
|
31
|
-
* Share of entities assigned to fit
|
|
30
|
+
* Share of entities assigned to fit.
|
|
31
|
+
* The rest are held out.
|
|
32
32
|
*/
|
|
33
33
|
const FIT_SPLIT_FRACTION = 0.8;
|
|
34
34
|
/**
|
|
35
|
-
* Train
|
|
35
|
+
* Train and emit the production dedup GBT.
|
|
36
36
|
*/
|
|
37
37
|
export async function trainDedupGBT(options, report) {
|
|
38
38
|
const SOURCES = options.sources || dataRootPath("record-matcher", "sources");
|
|
@@ -41,17 +41,15 @@ export async function trainDedupGBT(options, report) {
|
|
|
41
41
|
const OUT = options.out || "packages/registry/lib/models/dedup-gbt-en-us.ts";
|
|
42
42
|
const LOCALE = options.locale || "en-US";
|
|
43
43
|
const COST = options.cost ?? 1;
|
|
44
|
-
const TRAIN_DATE = options.date || isoDate();
|
|
44
|
+
const TRAIN_DATE = options.date || isoDate();
|
|
45
45
|
const REGISTRY = `${SOURCES}/nppes_npi-registry_20260607.tsv`;
|
|
46
46
|
const OTHER_NAMES = `${SOURCES}/nppes_other-names_20260607.tsv`;
|
|
47
|
-
// Build the variation-rich sample and corpus-wide address-frequency table.
|
|
48
|
-
// sample builder — the same records the dedup benchmark and the learned-scorer evals see). ---
|
|
49
47
|
const { rows, keptNpis, addressFrequency } = await buildNPPESSample({ registryPath: REGISTRY, otherNamesPath: OTHER_NAMES, state: STATE, maxNpis: NPIS }, report);
|
|
50
|
-
//
|
|
51
|
-
// injected (see ./eval-geocoder.ts) — the registry package never imports the runtime. ---
|
|
48
|
+
// The geocoder is injected, since the registry package never imports the runtime.
|
|
52
49
|
report?.("[C] geocoding…");
|
|
53
50
|
const geocoder = await options.createGeocoder();
|
|
54
|
-
//
|
|
51
|
+
// `record.id` supplies the NPI label.
|
|
52
|
+
// Multiple records can share an NPI as ground truth.
|
|
55
53
|
const mapping = {
|
|
56
54
|
id: "npi",
|
|
57
55
|
name: "name",
|
|
@@ -65,7 +63,6 @@ export async function trainDedupGBT(options, report) {
|
|
|
65
63
|
geocoder[Symbol.dispose]();
|
|
66
64
|
const geocoded = records.filter((r) => r.address?.geocode).length;
|
|
67
65
|
report?.(` ${records.length} records, ${geocoded} geocoded`);
|
|
68
|
-
// Block records, generate shared features, then assign labels.
|
|
69
66
|
report?.("[D] blocking + featurizing…");
|
|
70
67
|
const comparisons = buildDefaultModel({ collapseSpatial: true, addressFrequency }).comparisons;
|
|
71
68
|
const featurize = createMatchFeaturizer({ comparisons, addressFrequency });
|
|
@@ -73,16 +70,16 @@ export async function trainDedupGBT(options, report) {
|
|
|
73
70
|
const X = pairs.map(([a, b]) => featurize(a, b));
|
|
74
71
|
const Y = pairs.map(([a, b]) => (a.id === b.id ? 1 : 0));
|
|
75
72
|
const posRate = Y.reduce((s, v) => s + v, 0) / Math.max(1, Y.length);
|
|
76
|
-
const W = Y.map((y) => (y === 1 ? 1 - posRate : posRate * COST));
|
|
73
|
+
const W = Y.map((y) => (y === 1 ? 1 - posRate : posRate * COST));
|
|
77
74
|
const hyperparams = { rounds: 120, depth: 3, lr: 0.3, minLeaf: 20 };
|
|
78
75
|
if (COST !== 1) {
|
|
79
76
|
report?.(` cost-sensitive: negative class weighted ×${COST} (penalize over-merge)`);
|
|
80
77
|
}
|
|
81
|
-
// Calibrate the default link threshold
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
// The shipped full-data model has near-identical logit calibration, so the threshold transfers.
|
|
78
|
+
// Calibrate the default link threshold.
|
|
79
|
+
// The GBT logit uses no Fellegi-Sunter weight units.
|
|
80
|
+
// With class-balanced weights, logit 0 ignores the roughly 1% match base rate and over-merges.
|
|
81
|
+
// The threshold is swept on a held-out 20% of NPIs.
|
|
82
|
+
// The shipped full-data model has near-identical logit calibration, so the threshold transfers.
|
|
86
83
|
report?.("[E] calibrating the default link threshold on a held-out NPI split…");
|
|
87
84
|
const rnd = makeLcg(20_260_615);
|
|
88
85
|
const split = new Map();
|
|
@@ -112,12 +109,11 @@ export async function trainDedupGBT(options, report) {
|
|
|
112
109
|
}
|
|
113
110
|
}
|
|
114
111
|
report?.(` recommended link threshold ${recommendedThreshold.toFixed(3)} (held-out clustering F1 ${(100 * bestF1).toFixed(1)}%)`);
|
|
115
|
-
// Train the shipped model on every available pair.
|
|
116
112
|
report?.("[F] training the shipped model on all pairs…");
|
|
117
113
|
const model = trainGBT(X, Y, W, hyperparams);
|
|
118
114
|
report?.(` ${pairs.length} pairs (${(100 * posRate).toFixed(1)}% positive), ${model.trees.length} trees`);
|
|
119
|
-
// Emit the model as a committed TypeScript module with a prettier-stable literal
|
|
120
|
-
// retrain produces a clean one-line diff
|
|
115
|
+
// Emit the model as a committed TypeScript module with a prettier-stable literal,
|
|
116
|
+
// so a retrain produces a clean one-line diff.
|
|
121
117
|
const meta = {
|
|
122
118
|
version: "1.0.0",
|
|
123
119
|
locale: LOCALE,
|
|
@@ -127,9 +123,9 @@ export async function trainDedupGBT(options, report) {
|
|
|
127
123
|
records: records.length,
|
|
128
124
|
pairs: pairs.length,
|
|
129
125
|
posRate: Number(posRate.toFixed(4)),
|
|
130
|
-
costNegative: COST,
|
|
126
|
+
costNegative: COST,
|
|
131
127
|
hyperparams,
|
|
132
|
-
recommendedThreshold: Number(recommendedThreshold.toFixed(4)),
|
|
128
|
+
recommendedThreshold: Number(recommendedThreshold.toFixed(4)),
|
|
133
129
|
features: X[0]?.length ?? 0,
|
|
134
130
|
addressFrequencyDistinct: addressFrequency.distinct,
|
|
135
131
|
addressFrequencyTotal: addressFrequency.total,
|
|
@@ -148,9 +144,9 @@ export async function trainDedupGBT(options, report) {
|
|
|
148
144
|
` */\n\n` +
|
|
149
145
|
`import type { GBT } from "@mailwoman/match"\n\n` +
|
|
150
146
|
`/** Provenance for the bundled model — what it was trained on. */\n` +
|
|
151
|
-
`export const DEDUP_GBT_META = ${
|
|
147
|
+
`export const DEDUP_GBT_META = ${prettyJSON(meta)} as const\n\n` +
|
|
152
148
|
`// prettier-ignore\n` +
|
|
153
|
-
`export const DEDUP_GBT_MODEL: GBT = ${
|
|
149
|
+
`export const DEDUP_GBT_MODEL: GBT = ${stringifyJSON(model)}\n`;
|
|
154
150
|
await makeDirectories(dirname(OUT));
|
|
155
151
|
await writeLocalFile(moduleSource, OUT);
|
|
156
152
|
report?.(`[written] ${OUT} (${(moduleSource.length / 1024).toFixed(0)} KB)`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gbt.js","sourceRoot":"","sources":["../../../
|
|
1
|
+
{"version":3,"file":"gbt.js","sourceRoot":"","sources":["../../../tools/train/gbt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC5E,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEjC,OAAO,EACN,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,UAAU,EACV,eAAe,GAGf,MAAM,QAAQ,CAAA;AAEf,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE5D;;;GAGG;AACH,MAAM,kBAAkB,GAAG,GAAG,CAAA;AA4D9B;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAClC,OAA6B,EAC7B,MAA+B;IAE/B,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,YAAY,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAA;IAC5E,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,CAAA;IAClC,MAAM,IAAI,GAAG,OAAO,CAAC,IAA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EAAE,gBAAgB,CAAC,QAAQ;QACnD,qBAAqB,EAAE,gBAAgB,CAAC,KAAK;KAC7C,CAAA;IAED,MAAM,YAAY,GACjB,OAAO;QACP,iCAAiC;QACjC,wBAAwB;QACxB,mCAAmC;QACnC,MAAM;QACN,qIAAqI;QACrI,MAAM;QACN,qGAAqG;QACrG,6BAA6B,KAAK,KAAK,QAAQ,CAAC,IAAI,WAAW,KAAK,CAAC,MAAM,mCAAmC;QAC9G,gGAAgG;QAChG,8FAA8F;QAC9F,SAAS;QACT,iDAAiD;QACjD,qEAAqE;QACrE,iCAAiC,UAAU,CAAC,IAAI,CAAC,eAAe;QAChE,sBAAsB;QACtB,uCAAuC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAA;IAEhE,MAAM,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;IACnC,MAAM,cAAc,CAAC,YAAY,EAAE,GAAG,CAAC,CAAA;IACvC,MAAM,EAAE,CAAC,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IAE5E,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE,CAAA;AAClF,CAAC"}
|
|
@@ -3,65 +3,78 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* Train the
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* systems (certification vs quality reporting), each with independently-entered name + address.
|
|
11
|
-
* Measured drift across the national join (n≈5.4k): 12.2% name, 4.9% address — the rename /
|
|
12
|
-
* system-vs-facility / acquisition class the org objective exists for.
|
|
6
|
+
* Train the organization-level cross-source link scorer. The practitioner cross-source GBT does
|
|
7
|
+
* not transfer to organization records because its person-name features go dark. The organization
|
|
8
|
+
* cross-dataset flows therefore pin the FS baseline. CMS Provider of Services joins Care Compare
|
|
9
|
+
* by CCN. Each system represents the same facility and maintains its name and address separately.
|
|
13
10
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* `registry/models/org-crosssource-gbt-en-us.ts`.
|
|
11
|
+
* The pipeline runs a national CCN join into one record per source per facility, then the shared
|
|
12
|
+
* `trainCrossSourceModel` geocodes the rows and blocks the union. It keeps cross-source pairs.
|
|
13
|
+
* It featurizes them with the shared featurizer and labels them by CCN.
|
|
14
|
+
* Calibration uses held-out CCNs.
|
|
15
|
+
* The function emits `registry/models/org-crosssource-gbt-en-us.ts`.
|
|
19
16
|
*
|
|
20
17
|
* Sources (both public domain, direct CSVs):
|
|
21
18
|
*
|
|
22
|
-
* - `cms-pos_hospital-other_*.csv
|
|
23
|
-
* - `cms-carecompare_hospital-general_*.csv
|
|
19
|
+
* - `cms-pos_hospital-other_*.csv`: Provider of Services (PRVDR_NUM, FAC_NAME, ST_ADR…).
|
|
20
|
+
* - `cms-carecompare_hospital-general_*.csv`: Care Compare (Facility ID, Facility Name, Address…).
|
|
24
21
|
*
|
|
25
22
|
* Run: `mailwoman registry train-scorer org-cross-gbt [--cap 6000] [--precision-bar 0.95]
|
|
26
23
|
* [--wof <admin.db>] [--data-root <dir>] [--out registry/models/org-crosssource-gbt-en-us.ts]`
|
|
27
24
|
*/
|
|
25
|
+
import { type PathBuilderLike } from "path-ts";
|
|
28
26
|
import type { EvalGeocoderFactory } from "#tools/eval-geocoder";
|
|
29
27
|
/**
|
|
30
28
|
* Options for {@linkcode trainOrgCrossSourceGBT}.
|
|
31
29
|
*/
|
|
32
30
|
export interface TrainOrgCrossSourceGBTOptions {
|
|
33
31
|
/**
|
|
34
|
-
* The injected geocoder factory
|
|
32
|
+
* The injected geocoder factory.
|
|
33
|
+
*
|
|
34
|
+
* The command wires `mailwoman/geocode-core`, as `./eval-geocoder.ts` does.
|
|
35
35
|
*/
|
|
36
36
|
createGeocoder: EvalGeocoderFactory;
|
|
37
37
|
/**
|
|
38
|
-
* Record-matcher sources directory.
|
|
38
|
+
* Record-matcher sources directory.
|
|
39
|
+
*
|
|
40
|
+
* Default `$MAILWOMAN_DATA_ROOT/record-matcher/sources`.
|
|
39
41
|
*/
|
|
40
|
-
sources?:
|
|
42
|
+
sources?: PathBuilderLike;
|
|
41
43
|
/**
|
|
42
|
-
* Care Compare facilities sampled.
|
|
44
|
+
* Care Compare facilities sampled.
|
|
45
|
+
*
|
|
46
|
+
* Default 6000.
|
|
43
47
|
*/
|
|
44
48
|
cap?: number;
|
|
45
49
|
/**
|
|
46
|
-
* Output TS module path.
|
|
50
|
+
* Output TS module path.
|
|
51
|
+
*
|
|
52
|
+
* Default `registry/models/org-crosssource-gbt-en-us.ts`.
|
|
47
53
|
*/
|
|
48
54
|
out?: string;
|
|
49
55
|
/**
|
|
50
|
-
* Locale recorded in the model meta.
|
|
56
|
+
* Locale recorded in the model meta.
|
|
57
|
+
*
|
|
58
|
+
* Default en-US.
|
|
51
59
|
*/
|
|
52
60
|
locale?: string;
|
|
53
61
|
/**
|
|
54
|
-
*
|
|
62
|
+
* Max cross-source recall subject to this held-out pairwise precision.
|
|
63
|
+
* Default 0.95.
|
|
55
64
|
*/
|
|
56
65
|
precisionBar?: number;
|
|
57
66
|
/**
|
|
58
|
-
*
|
|
67
|
+
* The training date stored in the metadata.
|
|
68
|
+
*
|
|
69
|
+
* Default today.
|
|
59
70
|
*/
|
|
60
71
|
date?: string;
|
|
61
72
|
}
|
|
62
73
|
/**
|
|
63
|
-
* Train
|
|
64
|
-
*
|
|
74
|
+
* Train and emit the org-level cross-source link GBT.
|
|
75
|
+
*
|
|
76
|
+
* The CCN is the cross-system facility key.
|
|
77
|
+
* It is stored in {@link CrossSourceRow.npi} and copied to `record.id` as the held-out label.
|
|
65
78
|
*/
|
|
66
79
|
export declare function trainOrgCrossSourceGBT(options: TrainOrgCrossSourceGBTOptions, report?: (line: string) => void): Promise<{
|
|
67
80
|
out: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"org-cross-gbt.d.ts","sourceRoot":"","sources":["../../../
|
|
1
|
+
{"version":3,"file":"org-cross-gbt.d.ts","sourceRoot":"","sources":["../../../tools/train/org-cross-gbt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAG3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAG/D;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC7C;;;;OAIG;IACH,cAAc,EAAE,mBAAmB,CAAA;IACnC;;;;OAIG;IACH,OAAO,CAAC,EAAE,eAAe,CAAA;IACzB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACb;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC3C,OAAO,EAAE,6BAA6B,EACtC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,oBAAoB,EAAE,MAAM,CAAA;CAAE,CAAC,CAkGvE"}
|
|
@@ -3,47 +3,46 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* Train the
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* systems (certification vs quality reporting), each with independently-entered name + address.
|
|
11
|
-
* Measured drift across the national join (n≈5.4k): 12.2% name, 4.9% address — the rename /
|
|
12
|
-
* system-vs-facility / acquisition class the org objective exists for.
|
|
6
|
+
* Train the organization-level cross-source link scorer. The practitioner cross-source GBT does
|
|
7
|
+
* not transfer to organization records because its person-name features go dark. The organization
|
|
8
|
+
* cross-dataset flows therefore pin the FS baseline. CMS Provider of Services joins Care Compare
|
|
9
|
+
* by CCN. Each system represents the same facility and maintains its name and address separately.
|
|
13
10
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* `registry/models/org-crosssource-gbt-en-us.ts`.
|
|
11
|
+
* The pipeline runs a national CCN join into one record per source per facility, then the shared
|
|
12
|
+
* `trainCrossSourceModel` geocodes the rows and blocks the union. It keeps cross-source pairs.
|
|
13
|
+
* It featurizes them with the shared featurizer and labels them by CCN.
|
|
14
|
+
* Calibration uses held-out CCNs.
|
|
15
|
+
* The function emits `registry/models/org-crosssource-gbt-en-us.ts`.
|
|
19
16
|
*
|
|
20
17
|
* Sources (both public domain, direct CSVs):
|
|
21
18
|
*
|
|
22
|
-
* - `cms-pos_hospital-other_*.csv
|
|
23
|
-
* - `cms-carecompare_hospital-general_*.csv
|
|
19
|
+
* - `cms-pos_hospital-other_*.csv`: Provider of Services (PRVDR_NUM, FAC_NAME, ST_ADR…).
|
|
20
|
+
* - `cms-carecompare_hospital-general_*.csv`: Care Compare (Facility ID, Facility Name, Address…).
|
|
24
21
|
*
|
|
25
22
|
* Run: `mailwoman registry train-scorer org-cross-gbt [--cap 6000] [--precision-bar 0.95]
|
|
26
23
|
* [--wof <admin.db>] [--data-root <dir>] [--out registry/models/org-crosssource-gbt-en-us.ts]`
|
|
27
24
|
*/
|
|
28
25
|
import { dataRootPath } from "@mailwoman/core/data-root";
|
|
29
26
|
import { isoDate } from "@mailwoman/core/utils";
|
|
27
|
+
import { resolvePath } from "path-ts";
|
|
30
28
|
import { addressFrequencyKey, streamRows } from "#index";
|
|
31
29
|
import { addr, norm, trainCrossSourceModel } from "#tools/shared";
|
|
32
30
|
/**
|
|
33
|
-
* Train
|
|
34
|
-
*
|
|
31
|
+
* Train and emit the org-level cross-source link GBT.
|
|
32
|
+
*
|
|
33
|
+
* The CCN is the cross-system facility key.
|
|
34
|
+
* It is stored in {@link CrossSourceRow.npi} and copied to `record.id` as the held-out label.
|
|
35
35
|
*/
|
|
36
36
|
export async function trainOrgCrossSourceGBT(options, report) {
|
|
37
|
-
const SOURCES = options.sources
|
|
37
|
+
const SOURCES = resolvePath(options.sources ?? dataRootPath("record-matcher", "sources"));
|
|
38
38
|
const CAP = options.cap ?? 6000;
|
|
39
39
|
const OUT = options.out || "packages/registry/lib/models/org-crosssource-gbt-en-us.ts";
|
|
40
40
|
const LOCALE = options.locale || "en-US";
|
|
41
|
-
//
|
|
41
|
+
// Max cross-source recall subject to this held-out pairwise precision.
|
|
42
42
|
const PRECISION_BAR = options.precisionBar ?? 0.95;
|
|
43
43
|
const TRAIN_DATE = options.date || isoDate();
|
|
44
44
|
const POS = `${SOURCES}/cms-pos_hospital-other_2026q1.csv`;
|
|
45
45
|
const CARE_COMPARE = `${SOURCES}/cms-carecompare_hospital-general_20260706.csv`;
|
|
46
|
-
// Build Care Compare facility records with facility ID, name, and address.
|
|
47
46
|
report?.("[A] streaming Care Compare…");
|
|
48
47
|
const ccByID = new Map();
|
|
49
48
|
for await (const r of streamRows(CARE_COMPARE)) {
|
|
@@ -57,7 +56,6 @@ export async function trainOrgCrossSourceGBT(options, report) {
|
|
|
57
56
|
ccByID.set(ccn, { npi: ccn, name, org: name, address, source: "care-compare" });
|
|
58
57
|
}
|
|
59
58
|
report?.(` ${ccByID.size} Care Compare facilities`);
|
|
60
|
-
// Join the same CCNs from POS with the corpus-wide address-frequency table.
|
|
61
59
|
report?.("[B] streaming POS + building the frequency table…");
|
|
62
60
|
const rows = [];
|
|
63
61
|
const joined = new Set();
|
|
@@ -88,8 +86,6 @@ export async function trainOrgCrossSourceGBT(options, report) {
|
|
|
88
86
|
frequency: (v) => (v ? (addrCounts.get(addressFrequencyKey(v)) ?? 0) / addrTotal : 0),
|
|
89
87
|
};
|
|
90
88
|
report?.(` ${joined.size} CCN-joined facilities → ${rows.length} records`);
|
|
91
|
-
// Run the shared cross-source trainer: geocode, form pairs, calibrate, and train.
|
|
92
|
-
// → shipped model → committed module). ---
|
|
93
89
|
return trainCrossSourceModel({
|
|
94
90
|
createGeocoder: options.createGeocoder,
|
|
95
91
|
rows,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"org-cross-gbt.js","sourceRoot":"","sources":["../../../
|
|
1
|
+
{"version":3,"file":"org-cross-gbt.js","sourceRoot":"","sources":["../../../tools/train/org-cross-gbt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAwB,MAAM,SAAS,CAAA;AAE3D,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAExD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,qBAAqB,EAAuB,MAAM,eAAe,CAAA;AAiDtF;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC3C,OAAsC,EACtC,MAA+B;IAE/B,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,OAAO,IAAI,YAAY,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC,CAAA;IACzF,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,IAAI,CAAA;IAC/B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,2DAA2D,CAAA;IACtF,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAA;IACxC,uEAAuE;IACvE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c,CAAC;SACpC,CAAC;QACF,MAAM;KACN,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -3,31 +3,36 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* = `lat,lon` per facility
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* Convert the TX hhsc nursing-facilities source into the OaRow jsonl the resolver eval consumes.
|
|
7
|
+
* The source ships an authoritative `Geo Location` = `lat,lon` per facility, so the geocoder is
|
|
8
|
+
* graded against the provided coordinates on real facility addresses. `oa-resolver-eval
|
|
9
|
+
* --address-points` reports a great-circle delta and a tier breakdown.
|
|
10
10
|
*
|
|
11
|
-
* Neutral scope: this measures
|
|
11
|
+
* Neutral scope: this measures geocoder accuracy on real public addresses and makes no claim about
|
|
12
12
|
* the facilities themselves.
|
|
13
13
|
*
|
|
14
14
|
* Run: `mailwoman registry convert tx-hhsc [--src <tsv>] [--out /tmp/txhhsc-oarow.jsonl]`
|
|
15
15
|
*/
|
|
16
|
+
import type { PathBuilderLike } from "path-ts";
|
|
16
17
|
/**
|
|
17
18
|
* Options for {@linkcode convertTXHHSC}.
|
|
18
19
|
*/
|
|
19
20
|
export interface TXHHSCConvertOptions {
|
|
20
21
|
/**
|
|
21
|
-
* The TX
|
|
22
|
+
* The TX hhsc nursing-facilities TSV.
|
|
23
|
+
*
|
|
24
|
+
* Default `$MAILWOMAN_DATA_ROOT/record-matcher/sources/…`.
|
|
22
25
|
*/
|
|
23
|
-
src?:
|
|
26
|
+
src?: PathBuilderLike;
|
|
24
27
|
/**
|
|
25
|
-
* Output OaRow
|
|
28
|
+
* Output OaRow jsonl path.
|
|
29
|
+
*
|
|
30
|
+
* Default `/tmp/txhhsc-oarow.jsonl`.
|
|
26
31
|
*/
|
|
27
32
|
out?: string;
|
|
28
33
|
}
|
|
29
34
|
/**
|
|
30
|
-
* Convert the TX
|
|
35
|
+
* Convert the TX hhsc nursing-facilities TSV into OaRow jsonl for `oa-resolver-eval`.
|
|
31
36
|
*/
|
|
32
37
|
export declare function convertTXHHSC(options?: TXHHSCConvertOptions, report?: (line: string) => void): Promise<{
|
|
33
38
|
written: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"txhhsc-to-oarow.d.ts","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"txhhsc-to-oarow.d.ts","sourceRoot":"","sources":["../../tools/txhhsc-to-oarow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAK9C;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;;OAIG;IACH,GAAG,CAAC,EAAE,eAAe,CAAA;IACrB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;CACZ;AAID;;GAEG;AACH,wBAAsB,aAAa,CAClC,OAAO,GAAE,oBAAyB,EAClC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAkE5D"}
|