Experiment · Case studyTime-series forecasting experiment · 2026
Air-quality forecasting with a Temporal Fusion Transformer
Lower average error, weak uncertainty: a transformer that beats a naive baseline on average — and loses where it matters.
- Role
- Independent experiment · evaluation design
- Status
- Public source
- Disciplines
- Data Analytics · AI Engineering
- Links
- Source
Values and chart marker are for 12 hours ahead. The lines show errors across all 24 horizons.
TFT medianPersistence baselinePersistence winsTFT 10.7% lower error

Question
Can lower average carbon-monoxide forecast error coexist with unreliable uncertainty? The experiment uses hourly CO measurements (mg/m³) from the UCI Air Quality dataset.
Design
The implementation uses PyTorch Forecasting’s TFT rather than writing the architecture from scratch. Training, validation and test periods are split chronologically, and the evaluation covers both the median forecast and the P10–P90 interval. Same-origin persistence — repeating the last observed value for every future hour — is the deliberately simple benchmark the model must beat to justify its complexity.
Measurement
Across all 24 horizons, MAE is 1.109 mg/m³ against 1.203 for persistence: a 7.8% reduction. The 32,437 evaluated forecast-origin/horizon pairs cover 1,374 unique timestamps; overlapping windows are not independent observations.
Where it fails
The nominal 80% interval covers only 43.3% of observations overall. Persistence wins at both ends of the forecast window, including the next hour and the same hour tomorrow. The evidence ledger and chart show the full winning ranges. Lower point error does not establish reliable uncertainty. This is a single-site experiment, not an operational air-quality service.
Inspect the evidence
Code and methodology at source commit 26ee667. The interactive chart uses a local copy of the committed metrics and per-horizon CSV; per-horizon persistence MAE is derived from the same prediction CSV and checked against its aggregate.
Data attribution: Vito, S. (2008), Air Quality, UCI Machine Learning Repository, DOI 10.24432/C59K5F, CC BY 4.0 as documented in the source repository.