01 Production-minded ML / Python

Weather isn't
guessed.
It's measured.

26 years of daily observations. 18 engineered features. Six models judged on the same future holdout. The best run writes itself to forecast.txt.

Data window
2000 — 2026
Train / holdout
80 / 20
Best test MAE
1.77°C
forecast.out
RUN / 2026-06-16

Next-day mean temperature

16.67°C
0.03°C below the last day
01 JUNOBSERVED → FORECAST16 JUN
MODELWeather features gradient
TEST MAE1.77°C
01 / DAYS 9,656

clean days after feature engineering

02 / MODELS 6

models evaluated under one protocol

03 / TEST 1,932

future days held out from training

04 / ERROR 1.77°

best test mean absolute error

02 Observations / 2000—2026

One series.
Every signal.

Daily mean, min/max envelope and precipitation from the production CSV. Change the window and inspect any day.

weather_2000_2026.csv Latest observed window
15 JUN 2026 16.7°C min 13.7° / max 21.0° rain 0.0 mm
daily mean min — max range precipitation
FEATURE DICTIONARY / 18

Fields already produced by data.py

temp_avgtemp_mintemp_maxwind_speed previous_temp_avgtwo_days_ago_temp_avgthree_day_temp_avg seven_day_temp_avgtemp_changeseason_sinseason_cos season_sin_2season_cos_2season_sin_3season_cos_3 previous_temp_minprevious_temp_maxprevious_wind_speed
MONTHLY CLIMATE Mean temperature · 2000—2026
9,663 DAILY OBSERVATIONS

03 Evaluation / MAE

Six models.
One honest split.

Every candidate faces the same chronological holdout. Lowest MAE on the final 20% wins.

MODEL COMPARISONMAE · focused scale 1.70—1.90°C
EARLY STOPPINGActual epochs / 10,000 limit
TIME SPLITChronological / no shuffle
TRAIN7,724 days2000-01-08 → 2021-03-01
TEST1,932 daysfinal 20%

No future observation enters training. Time order stays intact.

04 Learned weights / best run

What moves
the forecast.

Learned coefficients from the latest run. Right is positive; left is negative. Zero remains visible.

WEATHER FEATURES GRADIENTLearned weights
bias +0.432

05 Architecture / 7 stages

From CSV to
forecast.txt

Seven explicit stages: load, transform, train, compare, forecast and write the result.

01data.py

Load and engineer

pandas reads the CSV, shifts the series, then builds rolling 3/7-day and seasonal features.

9,663 → 9,656
02preprocessing.py

Chronological split

The first 80% becomes train; the final 20% remains an untouched future holdout.

order preserved
03training.py

One evaluation run

Six models train and score through the same orchestration layer.

6 candidates
04gradient_model.py

Gradients from scratch

Weights, bias, MSE and early stopping are implemented as plain Python functions.

no ML framework
05evaluation.py

One shared metric

Every candidate resolves to MAE, keeping the comparison direct and consistent.

test_error ↓
06forecasting.py

Predict the next day

The winner receives the latest observations and the future date's seasonal phase.

2026-06-16
07reporting.py

Write an auditable result

The chosen model, date, last observation and prediction are saved together.

forecast.txt
ENTRYmain.py
data.pypreprocessing.py
baselinelineargradient
evaluation.pyforecasting.py
OUTPUTforecast.txt

06 Latest saved forecast

One number.
Full trace.

The forecast date follows the final CSV row. Update the dataset and the next day moves with it.

Last observation
15 Jun 2026 / 16.7°C
Forecast
16 Jun 2026 / 16.67°C
Selected model
Weather features gradient
forecast.txtsaved

01Next day forecast

02-----------------

03Model: Weather features gradient

04Last known date: 2026-06-15 00:00:00

05Forecast date: 2026-06-16

06Last temp avg: 16.7

07Predicted next temp avg: 16.67

07 Why the result is testable

Trust the test.
Not the headline.

This is a verifiable project snapshot, not a promise of permanent accuracy.

01

No future leakage

Lags and rolling means use past days only through shift(1).

02

Test follows train

No shuffling: evaluation reflects how the model performs later in time.

03

One common metric

MAE expresses all six approaches as the same average miss in degrees.

04

The result persists

Model, date, last observation and forecast remain in forecast.txt.

MODEL SELECTION MAE= 1n i=1n |ŷiyi|

Average model miss, measured in degrees

GRADIENT TRAINING MSE= 1n i=1n (ŷiyi)2

Loss function used during gradient training

SEASON CYCLE θk=2πkd365 fk(d)=[sin(θk),cos(θk)]

A continuous annual cycle with no December–January jump

08 Beta / next cycle

It works.
It isn't finished.

The current build is a verified static snapshot. Live runs and forecast history come next.

DONE01

Working ML pipeline

Data → features → models → evaluation → forecast.

DONE02

Project web dossier

Metrics, charts, weights and architecture in one interface.

NEXT03

Live API

Run the Python pipeline and request a fresh forecast from the site.

NEXT04

Forecast history

Compare each prediction with reality and track error over time.

LAB05

History since 1884

A dedicated mode for all 52,031 rows of the extended dataset.

LAB06

New signals

Pressure, precipitation, normalization and additional harmonics.