Air quality PM2.5 predictor for Algiers using Weka M5P
# Air Quality Predictor — Algiers 🌍
A desktop Java application that predicts **tomorrow's PM2.5 air quality** for Algiers, Algeria using machine learning (Weka M5P model tree). Built as a university time-series analysis project.
---
## Features
- **AI prediction** — M5P model tree trained on historical PM2.5 data, predicts next day's value
- **Intuitive input** — select how the air feels today (Fresh / Clean / Hazy / Heavy / Thick) as the current-day signal
- **Live clock** — real-time date and time displayed in the header
- **Historical stats** — shows average, worst, and best recorded PM2.5 from your dataset
- **AQI result card** — color-coded prediction with health advice and affected groups
- **Professional UI** — custom-painted Swing components, no emojis, no third-party UI libraries
---
## Project Structure
```
airquality/
├── src/
│ └── timeseries/
│ ├── Main.java # Entry point
│ ├── MainWindow.java # Full UI (Swing)
│ ├── AirQualityRecord.java # Data model (date + PM2.5)
│ ├── AirQualityDataLoader.java # CSV parser
│ ├── FeatureEngineer.java # Feature extraction for ML
│ └── WekaModel.java # Weka classifier wrapper
├── data/
│ └── algiers_sample.csv # Sample dataset (replace with your own)
├── lib/
│ └── weka.jar # Weka library (add manually — see Setup)
└── README.md
```
---
## Setup
### Requirements
- Java 17 or higher
- Weka 3.8 — download `weka.jar`
### Steps
1. **Clone the repository**
```bash
git clone
github.com
cd air-quality-predictor
```
2. **Add Weka**
- Download `weka.jar` from
waikato.github.io
- Place it in the `lib/` folder
3. **Compile**
```bash
mkdir -p out
javac -cp lib/weka.jar -d out src/timeseries/*.java
```
4. **Run**
```bash
java -cp out:lib/weka.jar timeseries.Main
```
On Windows use `;` instead of `:` in the classp …