Next-day mean temperature
01 Production-minded ML / Python
History meets
the forecast.
Then ML decides.
142 years of observations, seven local models and a second predictor built from 12 numerical weather systems, historical analogues and residual ML.
- Data window
- 1884 — 2026
- Train / holdout
- 80 / 20
- Forecast modes
- Local / Hybrid
daily records across the active archive
local candidates under one protocol
future days held out from training
numerical weather systems in hybrid mode
02 Observations / 1884—2026
One series.
Every signal.
Daily mean, min/max envelope and precipitation from the production CSV. Change the window and inspect any day.
Fields already produced by data.py
03 Evaluation / MAE
Seven models.
One honest split.
Every candidate faces the same chronological holdout. Lowest MAE on the final 20% wins.
No future observation enters training. Time order stays intact.
04 Hybrid forecast / live API
Twelve systems.
One correction layer.
Numerical forecasts set the baseline. Historical analogues add local context, then ridge ML learns the remaining error without touching the recent audit.
80% empirical interval20.20 — 21.83°C
Previous model runs are aligned with observed station temperatures.
The residual target is learned only from earlier dates.
Alpha and residual share are selected here.
The final quality check never changes model settings.
05 Learned weights / local model
What moves
the forecast.
The compact six-feature model exposes an interpretable coefficient set. Right is positive, left is negative and zero remains visible.
06 Architecture / two paths
Local when needed.
Hybrid when connected.
Both predictors start with the same long local history. One ends in a saved file; the other reaches calendar tomorrow through live forecasts.
data.pyLoad and engineer
pandas reads 142 years, fills wind gaps, then creates lags, rolling windows and three seasonal harmonics.
52,062 → 51,650preprocessing.pyChronological split
The first 80% becomes train; the final 20% remains an untouched future holdout.
order preservedtraining.pyOne evaluation run
Seven models train and score through the same orchestration layer.
7 candidatesgradient_model.pyAdvanced gradients
The 14-feature model uses NumPy matrix operations, a custom loss loop and early stopping.
vectorizedapi_weather_model.pyBuild the API baseline
Twelve numerical systems are bias-corrected and weighted by recent observed error.
12 providersapi_weather_model.pyLearn the residual
Historical analogues and 66 API-derived signals predict what the baseline still misses.
ridge MLreporting.pyWrite an auditable result
Local mode saves a trace to forecast.txt; hybrid mode prints its interval and backtest.
Deterministic, offline and tied to the next date in the dataset.
Targets calendar tomorrow and falls back to local analogues if APIs fail.
07 Latest saved local forecast
One number.
Full trace.
This is the latest result persisted by main.py.
It remains separate from the live hybrid run above.
- Last observation
- 16 Jul 2026 / 21.8°C
- Forecast
- 17 Jul 2026 / 21.41°C
- Selected model
- Advanced weather gradient
- Current-code check
- 17 Jul 2026 / 21.33°C · isolated
01Next day forecast
02-----------------
03Model: Advanced weather gradient
04Last known date: 2026-07-16 00:00:00
05Forecast date: 2026-07-17
06Last temp avg: 21.8
07Predicted next temp avg: 21.41
08 Why the result is testable
Trust the test.
Not the headline.
This is a verifiable project snapshot, not a promise of permanent accuracy.
No future leakage
Lags and rolling means use past days only through shift(1).
Test follows train
No shuffling: evaluation reflects how the model performs later in time.
One common metric
MAE expresses all seven local approaches as the same average miss in degrees.
Audit stays untouched
Hybrid parameters are chosen on validation; recent audit only measures the result.
Average model miss, measured in degrees
Loss function used during gradient training
Ridge ML learns only what the adaptive API baseline still misses
09 Beta / next cycle
It works.
It isn't finished.
The current build now documents both real predictors. The next work is operational: repeatable outputs, tests and history.
Working ML pipeline
Data → features → models → evaluation → forecast.
Project web dossier
Metrics, charts, weights and architecture in one interface.
Hybrid API model
12 forecasts + analogues + adaptive baseline + residual ridge.
Machine-readable runs
Persist local and hybrid metrics so the site can update automatically.
Forecast history
Compare every prediction with reality and track error over time.
Tests and caching
Cover the pipeline and cache historical API responses.