Skip to main content

Isotonic confidence calibration — neural-weights-en-us v4.4.0

Post-hoc calibration of the decoderdecoderIn a transformer encoder-decoder model, the part that produces output sequences. Mailwoman's classifier is encoder-only (no decoder); the 'CRF decoder' is a different thing — a structured-prediction layer that picks the best label sequence from the encoder's outputs.'s per-spanspanA contiguous range of characters or tokens in the input string, tagged with an address component type (street, locality, postcode, etc.). Parsed addresses are represented as collections of spans, possibly nested in a tree. softmaxsoftmaxThe function that converts a vector of logits into a probability distribution summing to 1, applied after priors and biases are added to the emission logits. confidence (the conf= a resolverresolverThe component that converts parsed address components (locality, region, postcode) into coordinates by looking them up in the gazetteer. The resolver ranks candidates by name match, population, and proximity, and returns the best-matching place with its centroid or polygon. or human reads off the parseaddress parsingThe process of decomposing a free-text postal address string into structured components — house number, street name, locality, region, postcode, and country — so a geocoder can resolve them to coordinates.). Method: isotonic regressionisotonic calibrationA post-hoc calibration that fits a monotonic map from raw model scores to true probabilities without retraining (via PAVA). Mailwoman's confidence calibrator. (PAVA) over (raw confidence, correct?) pairs from a 50/50 OpenAddressesOpenAddresses (OA). A global open aggregation of address points collected from many official sources. A primary source of component-supervised training data outside proprietary registries. + trainingtrainingThe process of adjusting a model's parameters so its predictions match labeled examples, by repeatedly measuring error and nudging the weights to reduce it. Distinct from inference, when the trained model is run on new input.-corpuscorpusThe BIO-labeled training data used to train Mailwoman's neural classifier. Assembled from real sources (OpenAddresses, National Address Database) and synthetic shards (boundary stress, order variants, negative space). Managed by @mailwoman/corpus. calibration set. Fit on 80%, every number below measured on the held-out 20%. Task #59 (#240 PR3).

correct? is a normalized exact-or-tokentokenOne word or subword in the tokenized input. For the neural classifier, tokens come from SentencePiece (subword units); for the rule classifiers, tokens are whitespace- and punctuation-separated words.-subset spanspanA contiguous range of characters or tokens in the input string, tagged with an address component type (street, locality, postcode, etc.). Parsed addresses are represented as collections of spans, possibly nested in a tree. match (so streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels. decomposition and multi-word fragmentation aren't penalized), so the absolute accuracy runs mildly optimistic — isotonic corrects the reliability shape, which the lenient threshold leaves intact. The corpuscorpusThe BIO-labeled training data used to train Mailwoman's neural classifier. Assembled from real sources (OpenAddresses, National Address Database) and synthetic shards (boundary stress, order variants, negative space). Managed by @mailwoman/corpus. half is in-domain (the modelneural classifierThe machine learning model at the core of Mailwoman's parser — a transformer encoder (~30M parameters) trained from scratch to do BIO token classification over addresses. It learns the 'grammar' of address formats; the gazetteer supplies the 'atlas.' trained on it); the OA-only row above is the trustworthy held-out ECEECE (Expected Calibration Error). A metric that measures how well a model's confidence scores align with its actual accuracy. Lower is better. Mailwoman's held-out ECE drops from 0.067 (raw) to 0.0035 (calibrated)..

Headline

SplitECEECE (Expected Calibration Error). A metric that measures how well a model's confidence scores align with its actual accuracy. Lower is better. Mailwoman's held-out ECE drops from 0.067 (raw) to 0.0035 (calibrated). rawECEECE (Expected Calibration Error). A metric that measures how well a model's confidence scores align with its actual accuracy. Lower is better. Mailwoman's held-out ECE drops from 0.067 (raw) to 0.0035 (calibrated). calibratedtarget
Combined (deliverable)0.06430.0034<0.05
OA-only (held-out, trustworthy)0.05930.0113
corpuscorpusThe BIO-labeled training data used to train Mailwoman's neural classifier. Assembled from real sources (OpenAddresses, National Address Database) and synthetic shards (boundary stress, order variants, negative space). Managed by @mailwoman/corpus.-only (in-domain)0.06820.0051

MCE (bins n≥20) 0.3303 → 0.1338 · Brier 0.0278 → 0.0224 · n_fit=28556 n_eval=7139 spansspanA contiguous range of characters or tokens in the input string, tagged with an address component type (street, locality, postcode, etc.). Parsed addresses are represented as collections of spans, possibly nested in a tree..

MCE is reported over bins with ≥20 samples. The modelneural classifierThe machine learning model at the core of Mailwoman's parser — a transformer encoder (~30M parameters) trained from scratch to do BIO token classification over addresses. It learns the 'grammar' of address formats; the gazetteer supplies the 'atlas.' is confident — ~94% of held-out spansspanA contiguous range of characters or tokens in the input string, tagged with an address component type (street, locality, postcode, etc.). Parsed addresses are represented as collections of spans, possibly nested in a tree. sit in [0.93, 1.0] — so equal-width bins below ~0.7 hold a handful of samples each and their all-bins max gap is single-sample noise, not a calibration failure. ECEECE (Expected Calibration Error). A metric that measures how well a model's confidence scores align with its actual accuracy. Lower is better. Mailwoman's held-out ECE drops from 0.067 (raw) to 0.0035 (calibrated). (sample-weighted) is the headline; it weightsparameterA single learned number inside a model — one weight or bias. Mailwoman's encoder has roughly 30 million of them; training is the search for good values. each bin by its mass.

Reliability (held-out eval, raw confidence)

confidence binnmean confaccuracygap
[0.00, 0.07)50.0060.0000.006
[0.07, 0.13)20.0930.5000.407
[0.13, 0.20)10.1881.0000.812
[0.20, 0.27)20.2461.0000.754
[0.27, 0.33)40.3051.0000.695
[0.33, 0.40)80.3800.3750.005
[0.40, 0.47)180.4360.6670.231
[0.47, 0.53)350.4980.8290.330
[0.53, 0.60)310.5670.7740.207
[0.60, 0.67)460.6400.8910.251
[0.67, 0.73)590.7030.9150.212
[0.73, 0.80)1370.7690.9120.144
[0.80, 0.87)2880.8380.8580.019
[0.87, 0.93)38430.9160.9860.070
[0.93, 1.00)26600.9460.9880.042

Reliability (held-out eval, calibrated confidence)

confidence binnmean calaccuracygap
[0.00, 0.07)20.0240.0000.024
[0.07, 0.13)10.1170.0000.117
[0.20, 0.27)10.2040.0000.204
[0.33, 0.40)10.3330.0000.333
[0.47, 0.53)100.4990.9000.401
[0.60, 0.67)10.6231.0000.377
[0.67, 0.73)270.7260.5930.134
[0.73, 0.80)240.7380.8330.095
[0.80, 0.87)4360.8530.8690.016
[0.87, 0.93)1530.9080.8950.012
[0.93, 1.00)64830.9880.9870.001

ECE by locale (held-out eval, raw → calibrated)

localelocaleThe combination of language and country an address comes from. en-US and fr-FR are the locales Mailwoman ships weights for.naccuracyECEECE (Expected Calibration Error). A metric that measures how well a model's confidence scores align with its actual accuracy. Lower is better. Mailwoman's held-out ECE drops from 0.067 (raw) to 0.0035 (calibrated). rawECEECE (Expected Calibration Error). A metric that measures how well a model's confidence scores align with its actual accuracy. Lower is better. Mailwoman's held-out ECE drops from 0.067 (raw) to 0.0035 (calibrated). calibrated
NL1880.9790.15200.0883
DE1890.8520.12760.1317
FR8030.9680.07340.0265
US59590.9800.06710.0079

ECE by tag (held-out eval, raw → calibrated)

tagnaccuracyECEECE (Expected Calibration Error). A metric that measures how well a model's confidence scores align with its actual accuracy. Lower is better. Mailwoman's held-out ECE drops from 0.067 (raw) to 0.0035 (calibrated). rawECEECE (Expected Calibration Error). A metric that measures how well a model's confidence scores align with its actual accuracy. Lower is better. Mailwoman's held-out ECE drops from 0.067 (raw) to 0.0035 (calibrated). calibrated
streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels.7920.9910.09800.0306
postcodepostcodeThe country-specific postal code (US ZIP, French code postal, etc.). Mailwoman handles postcode parsing entirely by rule classifier — a regex problem, not an ML one.15820.9750.09190.0248
venuevenueA named, non-address place — a business, building, park, or stadium. Mailwoman's free-text point-of-interest component, added as a Tier 2 fine label.4110.9810.08380.0218
regionregionThe first-level administrative subdivision of a country — a US state, a French region, a province. The component between country and locality.12190.9930.07330.0138
street_suffix5911.0000.07030.0167
localitylocalityThe city / town / settlement component of an address: a populated place sitting between region and neighbourhood in the hierarchy.16180.9740.05260.0220
house_number7680.9110.02160.0552

Abstention curve (calibrated confidence)

Accept spansspanA contiguous range of characters or tokens in the input string, tagged with an address component type (street, locality, postcode, etc.). Parsed addresses are represented as collections of spans, possibly nested in a tree. at or above the threshold; route the rest to review. PrecisionprecisionOf the spans the model labeled as a given tag, the fraction it got right. High precision means few false positives. Paired with recall to compute F1. is the accuracy of the accepted set.

thresholdcoveragecoverageThe fraction of a population or region for which a data source has real, non-placeholder entries — e.g. 47% rooftop coverage on Texas addresses. Distinct from accuracy on the rows that are present. (accepted)precisionprecisionOf the spans the model labeled as a given tag, the fraction it got right. High precision means few false positives. Paired with recall to compute F1.reviewed
0.5099.9%97.59%0.1%
0.8099.1%97.78%0.9%
0.9092.7%98.56%7.3%
0.9586.4%98.82%13.6%
0.9781.6%98.92%18.4%

The single global table is fit across all localeslocaleThe combination of language and country an address comes from. en-US and fr-FR are the locales Mailwoman ships weights for./tags, so it under-serves the worst-calibrated subgroups — the per-localelocaleThe combination of language and country an address comes from. en-US and fr-FR are the locales Mailwoman ships weights for. rows show where the one-size table leaves residual error (the OOD localeslocaleThe combination of language and country an address comes from. en-US and fr-FR are the locales Mailwoman ships weights for. and rare tags run far higher than the US/FR-dominated global ECEECE (Expected Calibration Error). A metric that measures how well a model's confidence scores align with its actual accuracy. Lower is better. Mailwoman's held-out ECE drops from 0.067 (raw) to 0.0035 (calibrated).). A per-localelocaleThe combination of language and country an address comes from. en-US and fr-FR are the locales Mailwoman ships weights for. table is the natural next step once the deployed multi-localelocaleThe combination of language and country an address comes from. en-US and fr-FR are the locales Mailwoman ships weights for. modelneural classifierThe machine learning model at the core of Mailwoman's parser — a transformer encoder (~30M parameters) trained from scratch to do BIO token classification over addresses. It learns the 'grammar' of address formats; the gazetteer supplies the 'atlas.' is the calibration target (#368).

20-bin lookup table (raw → calibrated)

bin centercalibrated
0.0250.475
0.0750.487
0.1250.487
0.1750.487
0.2250.487
0.2750.490
0.3250.526
0.3750.667
0.4250.731
0.4750.738
0.5250.800
0.5750.854
0.6250.854
0.6750.854
0.7250.854
0.7750.854
0.8250.854
0.8750.938
0.9250.992
0.9750.992

How it's wired

The table ships as data/eval/calibration/isotonic-en-us-v4.0.0.json and is turned into a (raw)=>calibrated function by the OPT-IN decoderdecoderIn a transformer encoder-decoder model, the part that produces output sequences. Mailwoman's classifier is encoder-only (no decoder); the 'CRF decoder' is a different thing — a structured-prediction layer that picks the best label sequence from the encoder's outputs. calibrator (core/decoder/calibration.tscreateCalibrator). Default parseaddress parsingThe process of decomposing a free-text postal address string into structured components — house number, street name, locality, region, postcode, and country — so a geocoder can resolve them to coordinates. output is unchanged (byte-stable); pass the calibrator via ParseOpts.calibrate / BuildTreeOpts.calibrate to emit calibrated conf=. Regenerate with scripts/eval/{build-calibration-set.py,collect-span-confidences.ts,fit-isotonic-calibration.py}.