Air quality degradation has become a critical environmental and public health issue, necessitating accurateand reliable classification models to support effective monitoring systems. This study aims toconduct a comparative analysis of four machine learning algorithms-Decision Tree, k-Nearest Neighbor (kNN), Naive Bayes, and Stochastic Gradient Descent (SGD)-for classifying air quality using environmental parameters, including particulate matter ≤ 2.5 μm (PM2.5), carbon monoxide (CO), temperature, humidity, nitrogen dioxide (NO2), and sulfur dioxide (SO2). The methodology employssupervised learning, where each model is trained and evaluated using classification accuracy, area under the receiver operating characteristic curve (AUC), F1-Score, precision, recall, and Matthews Correlation Coefficient (MCC), supported by ROC curve and confusion matrix analyses. The results show that the Decision Tree algorithm achieves the best overall performance, attaining a classification accuracy of 93.8% with a balanced precision, recall, and F1-Score, indicating strong and consistent predictive capability. The kNN and Naive Bayes models record the highest AUC values (0.980 and 0.982, respectively), demonstrating excellent class separability, although their accuracy and F1-Score are lower than those of the Decision Tree. In addition, the SGD model, implemented with a modified Huber loss function and L2 regularization, provides interpretable feature-weight analysis, identifyingPM2.5 and CO as dominant indicators of the Hazardous air quality class, while temperature and humidity significantly influence the Fair and Good classes. Based on the comprehensive evaluation, the Decision Tree algorithm is recommended as the most reliable model for accurate air quality classification, whereas the SGD model is particularly suitable for feature contribution analysis to enhance interpretability. These findings offer practical insights for selecting appropriate machine learning models in air quality monitoring and decision-support systems.
Copyrights © 2026