WebashalarForML commited on
Commit
df265b9
Β·
verified Β·
1 Parent(s): 1e216a1

Create README2.md

Browse files
Files changed (1) hide show
  1. README2.md +105 -0
README2.md ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ ---
4
+
5
+ # 🌍 AQI Forecasting Web App with Map Visualization
6
+
7
+ This Flask-based web application allows users to input geographical coordinates (latitude and longitude) and receive air quality forecasts (AQI) for the next three days. It combines a deep learning model with real-time data from the Weatherbit API, and visualizes predictions on an interactive map using Folium.
8
+
9
+ ---
10
+
11
+ ## πŸš€ Features
12
+
13
+ - 🌐 **Interactive Map**: View AQI predictions across different locations.
14
+ - πŸ“‘ **Real-Time Data**: Integrates live air quality data from Weatherbit API.
15
+ - 🧠 **Deep Learning Model**: Predicts AQI for the next 3 days based on PM2.5, PM10, NO2, SO2, CO, and current AQI.
16
+ - πŸ“Š **Comparative Visualization**: Shows bar plots comparing model predictions and API forecasts.
17
+ - πŸ“ **CSV Logging**: Stores prediction data and actual AQI values from API into CSV files.
18
+
19
+ ---
20
+
21
+ ## πŸ› οΈ Setup Instructions
22
+
23
+ ### 1. Clone the Repository
24
+
25
+ ```bash
26
+ git clone https://github.com/your-username/aqi-forecast-app.git
27
+ cd aqi-forecast-app
28
+ ```
29
+
30
+ ### 2. Install Requirements
31
+
32
+ We recommend using a virtual environment.
33
+
34
+ ```bash
35
+ pip install -r requirements.txt
36
+ ```
37
+
38
+ ### 3. Add Your API Key
39
+
40
+ Replace the `API_KEY` variable in `app.py` with your [Weatherbit API key](https://www.weatherbit.io/account/create).
41
+
42
+ ```python
43
+ API_KEY = "your_api_key_here"
44
+ ```
45
+
46
+ ### 4. Add Model and Scalers
47
+
48
+ Ensure the following model and scaler files are in the project directory:
49
+
50
+ - `FUTURE_AQI_v1.json`
51
+ - `FUTURE_AQI_v1.weights.h5`
52
+ - `scaler_X_cpcb_4.pkl`
53
+ - `scaler_y_cpcb_4.pkl`
54
+
55
+ > These are required to load the trained model and scale inputs/outputs.
56
+
57
+ ### 5. Run the App
58
+
59
+ ```bash
60
+ python app.py
61
+ ```
62
+
63
+ Visit [http://127.0.0.1:5000](http://127.0.0.1:5000) in your browser.
64
+
65
+ ---
66
+
67
+ ## πŸ“‚ File Structure
68
+
69
+ ```
70
+ .
71
+ β”œβ”€β”€ app.py # Main Flask app
72
+ β”œβ”€β”€ FUTURE_AQI_v1.json # Model architecture
73
+ β”œβ”€β”€ FUTURE_AQI_v1.weights.h5 # Trained model weights
74
+ β”œβ”€β”€ scaler_X_cpcb_4.pkl # Scaler for input features
75
+ β”œβ”€β”€ scaler_y_cpcb_4.pkl # Scaler for output predictions
76
+ β”œβ”€β”€ aqi_data.csv # Stores model predictions
77
+ β”œβ”€β”€ aqi_data_actual_api.csv # Stores actual API forecast data
78
+ └── templates/
79
+ └── aqi_forecast_with_legend.html # HTML template
80
+ ```
81
+
82
+ ---
83
+
84
+ ## πŸ“Š AQI Color Codes
85
+
86
+ The app uses the following colors for AQI categories:
87
+
88
+ | AQI Range | Color |
89
+ |----------------|--------------|
90
+ | 0–50 | Green |
91
+ | 51–100 | Light Green |
92
+ | 101–150 | Orange |
93
+ | 151–200 | Red |
94
+ | 201–300 | Purple |
95
+ | 301+ | Gray |
96
+
97
+ ---
98
+
99
+ ## πŸ“Œ Future Improvements
100
+
101
+ - πŸ“ Add support for historical AQI trends
102
+ - ⏳ Allow user-defined forecasting range
103
+ - πŸ“ˆ Deploy on cloud for public access
104
+
105
+ ---