Synthetic, reproducible example

Try a small prediction example

Run a simple model on invented records and compare its predictions with the known answers.

Entirely synthetic educational companion, not the original TF-IDF/gradient-boosting prototype, field validation, verified material classifications, or evidence of savings.

Run it locally

Python 3.10 or newer. Standard library only; no accounts, credentials, or external datasets. From the repository root:

python examples/lead-pipe-synthetic/demo.py
python -m unittest discover -s examples/lead-pipe-synthetic -p test_demo.py -v

Recorded demonstration results

These are outputs of the included teaching example, not measurements of a client system or field accuracy.

Held-out properties
200
Held-out groups
40
Shared groups
0
Model Brier score
0.1238
Lead pipe prediction: synthetic evaluation
Results from invented records, not field results from the lead-pipe project.
Held-out model comparison (lower loss is better)
PredictorBrier scoreLog lossAccuracy at 0.5
Logistic model0.12380.39510.8300
Training-prevalence baseline0.23870.67050.6350
Confusion counts at illustrative threshold 0.5
PredictorTrue negativeFalse positiveFalse negativeTrue positive
Logistic model110171756
Prevalence baseline1270730
Reliability bins (descriptive, not fitted calibration)
Probability intervalRecordsMean predictionObserved positive fraction
[0.0, 0.2)660.08730.0455
[0.2, 0.4)480.29350.1458
[0.4, 0.6)230.49770.4783
[0.6, 0.8)350.71190.7714
[0.8, 1.0]280.90840.8929
Error slices (overlapping, descriptive)
SliceRecordsBrier scoreFalse positiveFalse negative
Age present1780.11941515
Age missing220.158822
No conflicting record1680.11701314
Conflicting record320.159043
Five largest probability errors (invented held-out properties)
Synthetic propertySimulated targetPredictionAge missingRecord conflict
synthetic-group-120-property-00100.8983NoNo
synthetic-group-049-property-00200.8978NoNo
synthetic-group-099-property-00300.8853NoNo
synthetic-group-117-property-00010.1313NoNo
synthetic-group-078-property-00410.1372NoNo

Interpretation and limitations

  • All 800 records, group IDs, evidence and target labels are invented; signal is intentionally learnable.
  • Fixed seeds: data 2026, split 4173. Whole-group 75/25 split; no shared groups or properties.
  • Features and training settings were fixed before evaluation. No tuning, threshold choice or calibration uses test labels.
  • Reliability bins describe this one synthetic holdout; they do not establish calibrated probabilities.
  • The 0.5 threshold is illustrative, not an approved material classification or inspection rule.
  • Age and record-conflict slices overlap; small slices have unstable estimates. No confidence intervals are claimed.
  • Real evaluation needs verified labels and spatial, temporal and cross-utility holdouts; this example has none.
  • This companion is separate from the original professional OCR effort and any historical cost savings.

Image viewer

100%