Forecasting air quality in African cities to identify and analyze public health trends.
Forecasting Air Quality in Nakuru (An ARIMA Time Series Story)
Hello! Welcome to my project. This was a complete, top-to-bottom data science challenge where I rebuilt one of my favorite projects from my CV: forecasting air quality in Africa.
I started with a raw, messy .csv file and ended with a fully tuned, high-performance ARIMA model. This notebook is the story of that journey, showing how I battled messy data, found hidden patterns, and strategically built a model that works.
Data Source
The data for this project was downloaded from open.africa (the sensors.AFRICA archive), a fantastic open-source platform for air quality data.
Direct Link to Data: sensors.AFRICA Air Quality Archive - Nakuru (You can download it from Open Africa November 2025 Sensor Data Archive)
Raw File Used: Nakuru.csv (downloaded from the source above)
The Final Result
I'm thrilled with how this turned out. After all the cleaning and tuning, I built a final model that improved predictive performance by 26.2% over a simple baseline.
Model
MAE (Test Set)
Improvement
Baseline (Lag=1)
10.74
-
Final Tuned ARIMA(24, 0, 2)
7.92
26.2%
This project shows my ability to take a real-world problem and see it through, from identifying key patterns (like the 24-hour cycle) to building a robust model that delivers real, measurable improvements.
My Project Journey (The "How-To")
The complete, step-by-step analysis (with all my "Aha!" moments) is in the air-quality-analysis.ipynb notebook. Here’s the short story:
Battling the Data: The raw .csv file was a mess! The first challenge was just loading it. I had to battle ParserErrors by figuring out the file used semicolons (;) as separators and commas (,) for decimals. I also found corrupt text (like "17.?5") that I had to handle.
Preparing for Time Series: Once clean, I resampled the high-frequency data into stable 1-hour averages, converted the timezone to 'Africa/Nairobi', and made sure all my data types were correct.
The "A-ha!" Moment: The big breakth …