/MACHINE LEARNING

Karachi AQI Forecasting System

End-to-end ML system for forecasting Karachi air quality up to 72 hours ahead using automated feature pipelines, Hopsworks, and multiple forecasting models.

Karachi AQI forecasting system showing air-quality predictions and model-generated forecast results.
My role
Data Science Intern — 10Pearls SHINE
Tools & technologies
Python, Hopsworks, Feature Store, Model Registry, GitHub Actions, Ridge Regression, Random Forest, XGBoost, LSTM, Time Series Forecasting, Machine Learning, Data Pipelines
Data
live
Explore

Overview

Karachi AQI Forecasting System is an end-to-end machine learning project developed during my Data Science internship at 10Pearls SHINE. The system was designed to forecast Karachi's Air Quality Index (AQI) across 24-hour, 48-hour, and 72-hour horizons using continuously updated environmental data and automated ML pipelines.

Problem

Air quality can change considerably over short periods, making current AQI readings alone insufficient for understanding upcoming conditions. The objective was to build a forecasting pipeline capable of transforming continuously collected environmental data into future AQI predictions while also supporting model experimentation, evaluation, and monitoring.

Approach

I developed an automated feature pipeline that collected and processed hourly environmental data and stored engineered features in the Hopsworks Feature Store.

Multiple forecasting approaches were explored, including:

  • Ridge Regression
  • Random Forest
  • XGBoost
  • LSTM

Models were evaluated across multiple forecasting horizons to understand how predictive performance changed as the forecast window increased.

Hopsworks was used for feature management and model registry functionality, while GitHub Actions automated recurring pipeline execution.

ML Pipeline

The system followed an end-to-end workflow:

  1. Collect updated environmental and AQI data.
  2. Clean and transform incoming observations.
  3. Engineer forecasting features.
  4. Store features in the Hopsworks Feature Store.
  5. Train and evaluate forecasting models.
  6. Register model artifacts and results.
  7. Generate AQI forecasts for multiple horizons.
  8. Run the data pipeline automatically using GitHub Actions.

Model Evaluation

The project compared several machine learning and deep learning approaches rather than relying on a single forecasting model.

During one stable 24-hour forecasting run, the Ridge Regression model achieved:

  • RMSE: 7.74
  • MAE: 5.60
  • R²: 0.297

Performance was monitored as the available dataset evolved, which also highlighted practical challenges associated with limited samples, changing data distributions, and longer forecasting horizons.

Engineering

Beyond model training, the project focused on building a reproducible ML workflow.

Hopsworks provided centralized feature storage and model management, while automated GitHub Actions workflows allowed the feature pipeline to update without requiring manual execution.

This made the project an exercise not only in predictive modeling, but also in feature engineering, automation, model management, and production-oriented ML workflow design.

What I Learned

The project demonstrated how real-world forecasting performance can change as new data becomes available. It also highlighted the importance of monitoring data coverage, avoiding conclusions based on very small evaluation samples, and treating the surrounding data pipeline as an important part of an ML system rather than focusing only on model accuracy.

Limitations & context

The forecasting system was developed as an internship project and should be treated as an experimental ML system rather than an operational public-health forecasting service.

Model performance varied as the dataset grew and across different forecasting horizons. Some later evaluations produced negative R² values when sample sizes or forecast coverage were limited, demonstrating the sensitivity of the models to data availability and distribution changes.

Forecast coverage was also insufficient during some pipeline runs, causing evaluations to be skipped when there was not enough valid forecast data.

The project additionally depended on external infrastructure such as Hopsworks. During development, Hopsworks jobs occasionally encountered scheduling/resource issues, including insufficient CPU availability.

AQI forecasts generated by this project should therefore not be interpreted as official air-quality or health guidance.

Open to new projects

LET’S BUILDSOMETHING.

Have a problem worth solving? Let’s talk about what we can build together.

Start a conversation