# Ensemble learning for air quality index prediction: integrating gradient boosting, XGBoost, and stacking with SHAP-based interpretability

**Authors:** Sukhendra Singh, Manoj Kumar, Vishal Sengar, Abhay Kumar, Kumar Abhishek, B. M. Ahamed Shafeeq

PMC · DOI: 10.1038/s41598-026-39232-w · 2026-02-12

## TL;DR

This paper presents an ensemble machine learning model for predicting air quality index with high accuracy and interpretability using SHAP values.

## Contribution

A weighted Voting ensemble combining Gradient Boosting, XGBoost, and others with SHAP-based interpretability for AQI prediction.

## Key findings

- The ensemble model achieved a validation MSE of 0.6553 and R² of 0.9969, outperforming 15 baselines including LSTM.
- SHAP values provided interpretable insights into feature contributions for AQI prediction.
- The model showed temporal robustness with a ΔR² of -0.0037.

## Abstract

The increasing challenge of air pollution in cities requires smart methods to make proper predictions and manage the problem. Although machine learning and deep learning models have contributed greatly to weather and pollution forecasting, the main issue is the real-time flexibility, and scalability in the varying atmospheric conditions. This paper introduces a weighted Voting ensemble model that combines Gradient Boosting (\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym} 
				\usepackage{amsfonts} 
				\usepackage{amssymb} 
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$\times$$\end{document}4), CatBoost (\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym} 
				\usepackage{amsfonts} 
				\usepackage{amssymb} 
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$\times$$\end{document}3), XGBoost (\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym} 
				\usepackage{amsfonts} 
				\usepackage{amssymb} 
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$\times$$\end{document}2) and LightGBM (\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym} 
				\usepackage{amsfonts} 
				\usepackage{amssymb} 
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$\times$$\end{document}1) to improve the accuracy of Air Quality Index (AQI) forecasting. The full preprocessing (complete-case deletion, which retains extremes) and optimization of hyperparameters (GridSearchCV/Optuna, 5-fold CV) were used to enhance the robustness and generalizability of the model. The Taiwan Air Quality Dataset (2016–2024, \documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym} 
				\usepackage{amsfonts} 
				\usepackage{amssymb} 
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$n=4.6M$$\end{document} hourly records from 74 stations), 6 major pollutants (PM2.5, PM10, \documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym} 
				\usepackage{amsfonts} 
				\usepackage{amssymb} 
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$\hbox {NO}_2$$\end{document}, \documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym} 
				\usepackage{amsfonts} 
				\usepackage{amssymb} 
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$\hbox {O}_3$$\end{document}, \documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym} 
				\usepackage{amsfonts} 
				\usepackage{amssymb} 
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$\hbox {SO}_2$$\end{document}, CO), meteorological parameters (wind speed/direction), and 8-h averages) is used to model the data (spatial/temporal IDs are excluded, to allow deployment to a single station). Experimental validation of 60/16/24 splits (random + temporal validation) shows that the ensemble has validation MSE 0.6553 (\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym} 
				\usepackage{amsfonts} 
				\usepackage{amssymb} 
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$\hbox {R}^2$$\end{document}
0.9969), which beats 15 baselines including the deep learning (LSTM MSE 45.4), but has temporal robustness (\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym} 
				\usepackage{amsfonts} 
				\usepackage{amssymb} 
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$\Delta$$\end{document}
\documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym} 
				\usepackage{amsfonts} 
				\usepackage{amssymb} 
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$\hbox {R}^2$$\end{document}= − 0.0037). Moreover, SHAP is implemented to offer explainability, as it gives more insights into the contribution of features in predicting AQI. The results indicate the promise of interpretable ensemble learning systems to underpin sustainable urban living, reinforce community health programs, and allow interventions in managing air quality in time.

## Linked entities

- **Chemicals:** NO2 (PubChem CID 946), O3 (PubChem CID 24823), SO2 (PubChem CID 1119), CO (PubChem CID 281)

## Full-text entities

- **Chemicals:** CO (MESH:D002248), PM2.5 (-)

## Figures

5 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12976265/full.md

---
Source: https://tomesphere.com/paper/PMC12976265