--- library_name: pytorch pipeline_tag: tabular-regression tags: - machine-learning - deep-learning - air-quality - aqi-prediction - xgboost - lstm - pytorch - time-series - regression --- # AQI Eco-Nav Models Machine learning and deep learning models for **Air Quality Index (AQI) prediction** using air-quality and temporal features. This repository contains two independently trained models: - **XGBoost** — traditional machine learning model for tabular AQI prediction - **BiLSTM** — deep learning model for time-series AQI prediction Both models were trained using air-quality data from India. ## Models ### 1. XGBoost — Machine Learning **Model:** XGBoost Regressor **Task:** AQI regression **Model file:** ```text ml/xgb_aqi_model.pkl ``` #### Performance | Metric | Score | |---|---:| | MAE | 20.28 | | RMSE | 41.14 | | R² | 0.9076 | Training samples: **19,880** Test samples: **4,970** #### Preprocessing ```text ml/ ├── xgb_aqi_model.pkl ├── city_encoder.pkl ├── feature_medians.pkl └── model_meta.json ``` --- ### 2. BiLSTM — Deep Learning **Model:** 2-layer Bidirectional LSTM **Framework:** PyTorch **Task:** Time-series AQI regression **Architecture:** ```text 2×BiLSTM(hidden=128, bidirectional=True) ↓ FC(256) ↓ AQI Output ``` **Sequence length:** 7 **Model file:** ```text dl/lstm_aqi_model.pt ``` #### Performance | Metric | Score | |---|---:| | MAE | 17.21 | | RMSE | 25.39 | | R² | 0.8102 | Training samples: **19,734** Test samples: **2,468** #### Preprocessing ```text dl/ ├── lstm_aqi_model.pt ├── dl_scaler.pkl ├── dl_city_encoder.pkl ├── dl_feature_medians.pkl └── dl_model_meta.json ``` ## Model Comparison | Model | Type | MAE | RMSE | R² | |---|---|---:|---:|---:| | XGBoost | Machine Learning | 20.28 | 41.14 | **0.9076** | | BiLSTM | Deep Learning | **17.21** | **25.39** | 0.8102 | The **BiLSTM achieves lower MAE and RMSE**, while the **XGBoost model achieves a higher R²** on its respective test evaluation. Because the models use different evaluation setups, the metrics should not be interpreted as a direct apples-to-apples benchmark. ## Input Features Both models use the following 16 features: ```text PM2.5 PM10 NO NO2 NOx NH3 CO SO2 O3 Benzene Toluene Xylene Month DayOfYear DayOfWeek City_Enc ``` ## Supported Cities The models were trained using data from these cities: ```text Ahmedabad Aizawl Amaravati Amritsar Bengaluru Bhopal Brajrajnagar Chandigarh Chennai Coimbatore Delhi Ernakulam Gurugram Guwahati Hyderabad Jaipur Jorapokhar Kochi Kolkata Lucknow Mumbai Patna Shillong Talcher Thiruvananthapuram Visakhapatnam ``` ## Dataset The models were trained using air-quality data from India. Dataset source: https://www.kaggle.com/datasets/rohanrao/air-quality-data-in-india ## Model Files ```text aqi-eco-nav-models/ │ ├── ml/ │ ├── xgb_aqi_model.pkl │ ├── city_encoder.pkl │ ├── feature_medians.pkl │ └── model_meta.json │ └── dl/ ├── lstm_aqi_model.pt ├── dl_scaler.pkl ├── dl_city_encoder.pkl ├── dl_feature_medians.pkl └── dl_model_meta.json ``` ## Technologies ### Machine Learning - Python - XGBoost - Scikit-learn - Pandas - NumPy - Joblib ### Deep Learning - Python - PyTorch - Bidirectional LSTM - Scikit-learn - NumPy ## Intended Use These models are designed for: - AQI prediction - Air-quality analysis - Environmental monitoring - Machine learning research - Time-series forecasting experiments - Educational projects ## Disclaimer These models are intended for educational and research purposes. Predictions may vary when applied to real-world air-quality conditions outside the training data.