Model selection
In-PG audition: distance-from-best, max regret, regret-next-time, and DSSG’s selection rules.
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 + monitoringflowchart 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.
| Idea | What it means |
|---|---|
| An Experiment is a problem | Its 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-addressed | Every 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 rule | Features 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 |
# prerequisites: uv, Docker, justuv sync --extra dev --extra dashboardjust chi311-up # real Chicago 311 data, dockerized PostgreSQLuv run triage --dbfile chicago311-database.yaml db upgradeuv 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 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.
| Term | Meaning |
|---|---|
| Project | one isolated PostgreSQL database + a registry row |
| Experiment | the problem (a hash over the four problem keys) |
| Run | one attempt at an experiment; runs share cached artifacts |
| as_of_date | the decision moment that features must not see past |
| Cohort | who is scored at an as_of_date (templated SQL) |
| Matrix | entities × features Parquet, per split |
| Model group | algorithm + hyperparameters + feature list, across splits |
| Prediction | an append-only, timestamped score, never overwritten |
| Subset | a named cohort slice evaluated as its own population |
| Forward score | a scheduled scoring run; monitoring’s heartbeat |
| Page | What it covers |
|---|---|
| Tutorials | four case studies on dockerized real data: Dirty Duckling, DirtyDuck, Chicago 311, DonorsChoose |
| Concepts | the data model, point-in-time correctness, identity and caching, problem types, target history |
| Guides | reading the crosstabs, error trees, threshold curve, model card and the regression and survival diagnostics |
| CLI tour · Configuration | every command and every experiment.yaml key |
| FAQ | upgrades, where stored artifacts live, and common questions |
| vs DSSG triage | coming 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.