Dominion Akinrotimi
Back to Projects
PythonTime seriesscikit-learnForecasting

Next-Day Weather Forecasting for Lagos

The question: can a simple model forecast tomorrow's weather in Lagos better than the obvious rules, "tomorrow will be like today" or "the usual for this time of year"?

What I built: next-day forecasts for maximum temperature, minimum temperature and the chance of rain, using almost 5 years of daily data and tested on a year the models never saw.

View the code on GitHub

Results on 2026

Bar charts of forecast error: Ridge beats persistence and climatology for maximum and minimum temperature

Average error in °C for next-day temperature, January to October 2026.

ModelNext-day maxNext-day min
Persistence (tomorrow = today)0.70 °C0.72 °C
Climatology (day-of-year average)0.81 °C0.87 °C
Ridge regression0.59 °C0.59 °C

For rain (1 mm or more), the chosen model lowers the Brier score from 0.189 for the seasonal average to 0.163, and raises AUC from 0.78 to 0.82. Gradient boosting did worse than the simpler models: three years of daily data isn't enough for it.

Line chart of forecast and actual daily maximum temperature in Lagos during 2026

Forecast made the day before vs actual maximum temperature, 2026.

How I kept it honest

A correction I made: my first version reported R² of 0.98. It used the same day's readings, including the day's temperature range, which contains the answer, and a random split. This version forecasts the next day from past data only and tests on a later year.

Data: Open-Meteo historical archive (ERA5-based reanalysis) for central Lagos. It records light drizzle as rain more often than a rain gauge would.

Have data you cannot make sense of yet?

I turn raw data into dashboards, reports and decisions your team can act on.