Construction Readiness Γ— ML Γ— Agent

Turning pre-construction permit delays
into construction readiness signals

Using 227,603 Chicago building permits (2006–2019), I built a model to predict processing delays before construction and a diagnostic agent that works only from its outputs. One principle guides the system: tools over tokens. Every number comes from a deterministic tool; the LLM describes that evidence without adding facts.

Try the live agent β†’

01

Problem framing β€” permit delays are friction in construction readiness

Permit processing times depend on external approval queues beyond the control of owners and contractors. A delay can push back every downstream activity. This project answers three questions: (1) How many days will this permit take? (2) What is the probability that it will take unusually long relative to comparable permits? (3) What supports that judgment, and what happened in similar past cases? The goal is an evidence package that planners can use, beyond a single prediction.

02

Data β€” from 606K rows to 227,603 permits requiring review

The source contains 606K public Chicago permit records. Instant-issue categories such as EASY PERMIT (median 0 days, about 62% of records) were explicitly excluded because delay prediction does not apply to them. The remaining 227,603 permits undergo actual review. Processing time, the target variable, is strongly right-skewed: most permits finish within a few days, but the small number in the tail can derail a schedule.

Monthly permit application volume chart

Monthly application volume already signals that processing regimes change over time.

Processing-time histogram with a long right tail

Processing-time distribution β€” the long tail is the core challenge.

03

Leakage controls β€” use only what was known at application time

The distinguishing feature is discipline, not the model. An explicit feature allowlist and blocklist enforce one question: was this information available when the application was filed? Splits are chronological: train ≀2016 / valid 2017 / test 2018–2019. Even one source of future information would undermine the entire performance table.

Allowed (available at application)Blocked (outcome leakage)
permit / review typeISSUE_DATE
reported project cost (+missingness flag)PROCESSING_TIME
community areafee columns
application date features (year, month, weekday)post-outcome status fields
contact count and type diversityβ€”
work-description text statisticsβ€”
trailing volume and median from strictly earlier recordsβ€”
04

Pipeline β€” from raw CSV to risk card

The stages light up in sequence as this section enters the viewport.

Every stage is a rerunnable script, and each output passes an intermediate check. At the end of the pipeline, the agent assembles its diagnosis entirely through tool calls.

05

Results β€” a fully held-out 2018–2019 test

On the held-out 2018–2019 test, regression MAE is 22.0 days and median absolute error is 4.7 days. The gap between mean and median reflects the difficulty of the long-tailed distribution. High-risk classification achieves ROC-AUC 0.749 and PR-AUC 0.162 (base rate 6.6%); the top 10% of scores capture 28.1% of actual high-risk cases. These results are far from perfect, but they use only information available at application time.

Baseline and backlog feature-set performance comparison chart

Baseline versus +backlog features on the test period.

Metricbaseline (selected)+backlog
MAE (days)22.022.5
Median AE (days)4.75.0
ROC-AUC0.7490.739
PR-AUC0.1620.141
top-decile capture28.1%24.2%

The +backlog variant was slightly worse on every metric (red), so the baseline was selected. The figures come directly from models/metrics.json.

06

A reported negative result β€” backlog features made performance worse

Intuitively, a longer queue at application time should imply a longer delay. Yet adding trailing backlog features computed from strictly earlier records slightly worsened every metric (MAE 22.0β†’22.5, ROC-AUC 0.749β†’0.739). The explanation is temporal drift: backlog statistics learned from data through 2016 encoded a processing regime that had already changed by 2018–2019.

+backlog (intuition)

MAE 22.5 days Β· ROC-AUC 0.739 β€” adding trailing backlog features slightly worsened every metric

baseline (selected)

MAE 22.0 days Β· ROC-AUC 0.749 Β· PR-AUC 0.162 Β· top-decile capture 28.1% β€” trained only on application-time information; selected as the final model

This result is documented in the README. The next experiments are regime-normalized backlog and rolling-origin retraining. A negative result informs the design of the next experiment.
07

Explainability β€” which signals increase risk?

Test-set SHAP summary plot, with REVIEW_TYPE at the top

Test-set SHAP summary. REVIEW_TYPE is the dominant driver.

REVIEW_TYPE is the dominant driver: the review path accounts for half of the delay. Reported project cost (log_cost), community area, and contact diversity follow. Permit-level SHAP contributions are included directly in the agent’s predict_risk() output, providing a numerical answer to why a particular application is at risk.

08

The agent β€” tools over tokens

The diagnostic agent consists of three deterministic tools: predict_delay() (expected processing-time regression), predict_risk() (high-risk probability + SHAP contributions), retrieve_similar() (historical statistics for similar cohorts). A rule engine adds recommendations. Optionally, an LLM then writes a 4–6 sentence memo using only this evidence. The diagnosis is complete without the LLM; it provides convenience, not evidence.

Run the agent and inspect the flow yourself β†’

09

Why this project β€” limits and roadmap

Limits: one city, one regulatory system, data only through 2019, and statistical text features. Roadmap: regime-normalized backlog, rolling-origin retraining, and generalization tests in other jurisdictions.

GitHub repository (code, tests, and documentation) Try the live agent β†’ ← Portfolio home