MADRIDAire

Technical details

This layer gathers model, method, reports, and system as the product's second reading. If you want the public view, go back to Overview or Guide.

Technical details

Model v1 and metrics

This page explains which forecast model we use, which data it was checked against, and how to interpret its errors without losing the technical traceability.

Forecast model

NO2 model v1

active model

Horizon

24h

Training window

2025-01-08 → 2025-12-31

Test window

2026-01-01 → 2026-04-29

Current operational read

What is governing the system right now

Cloudflare D1 + ingestion

Cloudflare D1 is responding, but the signal is lagging

The API is already reading from Cloudflare D1, although the last valid observation is still 28 Sept 2026, 02:00. The next point to review is the protected ingestion cycle, not database connectivity.

Environment

production

reported by the API

Observation source

Cloudflare D1

active read path

Latest valid observation

28 Sept 2026, 02:00

over 12h old

Remote ingest

cron ready

D1 yes · jobs yes

MAE

7.85 µg/m³

Average expected gap between the forecast and the real measurement.

RMSE

11.96 µg/m³

How large the misses can become when conditions shift more sharply.

R²

0.43

How much of the real-world variation the model is able to explain.

NO2 · 24h

compared metrics

persistence

n=78077

MAE8.32
RMSE14.07
R²0.205

same_hour_yesterday

n=78077

MAE9.92
RMSE16.26
R²-0.062

hist_gradient_boosting_v1

n=78077

MAE7.85
RMSE11.96
R²0.426

This is an indicative forecast based on recent patterns. It does not replace official public warnings.

NO2 · error chart by model

MAE & RMSE compared

NO2 model v13 baselines comparedTest window: 2026-01-01 → 2026-04-29+5.6%
MAERMSEµg/m³
5914198.314.1Persist9.916.3Yesterday7.912.0Model

Model features

+5.6%improvement vs. baseline

01

Supervised learning

Trained on real readings from the official network, not on synthetic or simulated data.

02

24-hour horizon

Produces hourly forecasts for the next 24 hours from the moment of generation.

03

Temporal variables and station context

Includes time of day, day of week, month, weekend flag, and station encoding as the model's explanatory base.

04

Comparison against simple baselines

Each run is evaluated against the recent trend, the same hour yesterday, and the 24-hour average to validate genuine improvement.

Model v1 limits

01

No validated extreme episodes

Training data does not cover severe pollution episodes or exceptional meteorological events.

02

Coverage limited to the official network

The model produces station-level forecasts for the official network, but it does not interpolate beyond those points or generate a continuous surface across Madrid.

03

No real-time updates

Forecasts are regenerated on scheduled cycles, not with each new official reading.

04

Indicative, not regulatory

This forecast is an internal technical reference. It does not replace official air quality warnings.