Logo Lanfrica

lunaiile/air-quality-predictor

Domain:

environment and energy

Record type:

software
Creator:
lun
Host:
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 …