๐ How Diwali Impacts Air Quality: Insights from My AQI Prediction Model
October 21, 2025
Every year, Diwali brings a burst of lights, celebration, and, unfortunately, a spike in air pollution. Fireworks, increased traffic, and energy usage cause the Air Quality Index (AQI) to soar. This year, I decided to quantify that effect using a Random Forest Regressor trained on historical AQI data.
๐ My Approach
I collected hourly pollutant measurements from key air quality indicators like CO, NOโ, SOโ, Oโ, PM10, PM2.5, and NHโ. These were aggregated into daily averages, and I added temporal features such as month and weekday to capture seasonal patterns.
I then trained a Random Forest Regressor to predict the next dayโs AQI. This model allowed me to see how โnormalโ air quality would behave and then compare it to the unusual spikes during Diwali.
๐ก Key Findings
1. Pre-Diwali Predictions
- The model performed very well on days leading up to the festival, with an Rยฒ score of ~0.86.
- It could reliably forecast AQI using historical pollutant levels and temporal patterns.
2. Diwali Effect
- During the festival, the predicted AQI often underestimated actual readings by 20โ25 points.
- This shows how Diwali introduces an irregular spike in pollution that traditional temporal patterns cannot fully capture.
- The Month feature could not accurately preddict this festival change due to diwali being quite early this year.
3. Feature Importance
- The model highlighted that the previous day's AQI was the most influential predictor.
- When this feature was removed, performance dropped, indicating that AQI trends are strongly autocorrelated.
๐ Observations
- Diwali pushes AQI levels far above normal daily fluctuations.
- Temporal features like weekday or month are insufficient to capture sudden festival-driven surges.
- Predictive models need event-specific inputs (like festival dates) to better forecast extreme pollution events.
๐ฑ Implications
- Urban planners: anticipate pollution spikes and manage traffic or industrial activity.
- Healthcare providers: warn sensitive populations like children, elderly, and people with respiratory issues.
- Citizens: make informed decisions about outdoor activity or preventive measures.
๐Source
The complete code and dataset used for this analysis are available on my GitHub repository.
๐Go to AQI Project๐ Using AI for Cleaner Cities
My Random Forest model demonstrates how machine learning can capture normal AQI patterns, but it also highlights the limitations when sudden, human-driven events occur. By combining historical data, temporal features, and event-specific indicators, predictive models could help forecast pollution peaks more accurately and guide preventive action during festivals.
Diwali is beautiful, but its environmental cost is real. Using data and predictive models, we can better understand the consequences and take informed steps to mitigate pollution while still celebrating responsibly.
Note that my AQI predictions were done based on Pune's AQI Data set from 2017-24 with large number of values removed due to values being outliers and missing.