Skip to content
Documentation for triage-pg 1.6.7 — the current stable release. Release notes

Onboarding one-pager

Temporal ML for public-policy decisions, with PostgreSQL as the whole substrate. triage-pg is a deliberately simplified fork of DSSG’s triage.

early-warning systems resource prioritization 4 problem types incl. survival in-database evaluation fairness + audition + monitoring

The pipeline: one pass, every artifact content-addressed

Section titled “The pipeline: one pass, every artifact content-addressed”
flowchart LR
  T["your tables<br/><code>ontology.*</code>"] --> C["cohort + labels<br/>templated SQL"]
  C --> F["featurizer<br/>DFS · as-of joins"]
  F --> M["train<br/>grid × splits"]
  M --> P["predictions<br/>append-only"]
  P --> E["in-PG evaluation<br/>metrics · bias · audition"]
  P --> O["monitoring<br/>drift · volume · outcomes"]

Matrices live in Parquet. Everything that needs only (entity, score, label) runs as PL/pgSQL inside your project’s database.

The mental model: three ideas carry everything

Section titled “The mental model: three ideas carry everything”
IdeaWhat it means
An Experiment is a problemIts hash covers exactly {problem_type, cohort, labels, temporal grid}. Runs are attempts at it. Fairness audits, subsets and metric choices are identity-neutral: adding them never changes what problem it is.
Artifacts are content-addressedEvery cohort, label set, matrix and model is identified by a hash over its complete input closure (Guix-style). Caching, provenance and GC all follow, so re-running is cheap and reproducible by construction. Identity and caching
Point-in-time correctness is the cardinal ruleFeatures for an as_of_date may use only what was knowable strictly before it. The featurizer’s as-of joins and the fit-free/fit-based imputation split exist to protect that boundary. Point-in-time correctness
Terminal window
# prerequisites: uv, Docker, just
uv sync --extra dev --extra dashboard
just chi311-up # real Chicago 311 data, dockerized PostgreSQL
uv run triage --dbfile chicago311-database.yaml db upgrade
uv run triage --dbfile chicago311-database.yaml run \
example/chicago311/experiment.yaml --project-path /tmp/chi311-run
# inspect: the same views from the CLI, psql or the dashboard (just serve)
uv run triage --dbfile chicago311-database.yaml leaderboard <hash>
uv run triage --dbfile chicago311-database.yaml audition <hash>
uv run triage --dbfile chicago311-database.yaml postmodel error-tree <model-id>

The Chicago 311 tutorial walks through these commands and their output.

The dashboard: experiments, model-group × split heatmap, live run rail

The read dashboard shows model groups × temporal splits, audition, bias and monitoring. Every panel is a thin view over SQL. Dashboard tour

Model selection

In-PG audition: distance-from-best, max regret, regret-next-time, and DSSG’s selection rules.

Monitoring

Scheduled triage score plus drift (PSI/KS), volume, calibration and realized outcomes. No daemon: a cron line and four SQL objects.

Fairness

Per-group metrics with disparity and τ verdicts, config-driven ingestion, and the Aequitas fairness tree as a guidance wizard.

Multi-tenancy

One database per project plus a registry; triage project create/drop; a project switcher in the dashboard.

Diagnostics

Crosstabs, error trees, calibration, list overlap, per-entity contributions: the CLI computes once, PostgreSQL persists, the dashboard reads. Guides

Two profiles

Local (any standalone PostgreSQL) and cloud (RDS IAM + S3 + AWS Batch) behind one seam. Architecture

The full glossary is CONTEXT.md.

TermMeaning
Projectone isolated PostgreSQL database + a registry row
Experimentthe problem (a hash over the four problem keys)
Runone attempt at an experiment; runs share cached artifacts
as_of_datethe decision moment that features must not see past
Cohortwho is scored at an as_of_date (templated SQL)
Matrixentities × features Parquet, per split
Model groupalgorithm + hyperparameters + feature list, across splits
Predictionan append-only, timestamped score, never overwritten
Subseta named cohort slice evaluated as its own population
Forward scorea scheduled scoring run; monitoring’s heartbeat
PageWhat it covers
Tutorialsfour case studies on dockerized real data: Dirty Duckling, DirtyDuck, Chicago 311, DonorsChoose
Conceptsthe data model, point-in-time correctness, identity and caching, problem types, target history
Guidesreading the crosstabs, error trees, threshold curve, model card and the regression and survival diagnostics
CLI tour · Configurationevery command and every experiment.yaml key
FAQupgrades, where stored artifacts live, and common questions
vs DSSG triagecoming from DSSG triage? the side-by-side comparison

triage-pg is MIT-licensed and stands on DSSG/DSaPP’s triage: temporal cross-validation, leakage-safe features, model governance and the fairness tree are their ideas.