Analisis Komparasi Algoritma Machine Learning Untuk Klasifikasi Kualitas Udara Indoor Berbasis Sensor Low-Cost
Abstract
Indoor Air Quality (IAQ) has a significant impact on occupants’ health and comfort; however, limitations of conventional monitoring systems and the high cost of commercial devices have hindered the widespread implementation of indoor air quality monitoring. Sensor-based IAQ monitoring using low-cost devices provides an affordable solution; however, the resulting data often exhibit variability and noise, making direct interpretation challenging. This study presents a comparative analysis of several machine learning algorithms for indoor air quality classification using sensor data. The dataset was collected from DHT22 and MQ-135 sensors measuring temperature, humidity, and air pollutant levels, resulting in 18,000 samples evenly distributed across three air quality classes: Good, Moderate, and Poor. The proposed methodology includes data preprocessing through median imputation and feature standardization, stratified dataset splitting with a ratio of 70% training, 15% validation, and 15% testing data, and model training using four supervised learning algorithms: Logistic Regression, K-Nearest Neighbors (KNN), Support Vector Machine (SVM), and Gaussian Naive Bayes. Model performance was evaluated using accuracy, precision, recall, and F1-score metrics. Experimental results indicate that all evaluated models achieved high classification performance, with KNN outperforming other algorithms by achieving an F1-score of 1.00 on the test dataset, while the lowest-performing model still achieved an F1-score above 0.96, indicating a relatively narrow yet consistent performance range among the evaluated algorithms. These findings demonstrate the effectiveness of machine learning approaches for indoor air quality classification using low-cost sensor data under controlled experimental conditions.
Downloads
References
H. Budianto and B. Sumanto, “Perancangan Sistem Monitoring Kualitas Udara dalam Ruangan Berbasis Internet of Things,” Jurnal Listrik, Instrumentasi, dan Elektronika Terapan, vol. 5, no. 1, 2024, doi: https://doi.org/10.22146/juliet.v5i1.87423.
S. M. Nasri, A. D. Athari, L. R. Hastiti, and F. A. Putri, “Indoor Air Factors Affecting the Growth of Microorganism in an Indonesian Gas Company’s Dormitory,” Indonesian Journal of Occupational Safety and Health, vol. 11, no. 3, pp. 445–453, Nov. 2022, doi: 10.20473/ijosh.v11i3.2022.445-453.
W. Indah, D. Aurora, F. Kedokteran, and D. I. Kesehatan, “EFEK INDOOR AIR POLLUTION TERHADAP KESEHATAN,” Scientific Of Environmental Health and Diseases, vol. 1, no. 2, 2021, doi: https://doi.org/10.22437/esehad.v2i1.13750.
M. Mannan and S. G. Al-Ghamdi, “Indoor air quality in buildings: A comprehensive review on the factors influencing air pollution in residential and commercial structure,” Mar. 02, 2021, MDPI AG. doi: 10.3390/ijerph18063276.
M. Gurung, S. Kaini, K. Bhandari, I. Panta, and N. Singh, “IoT Based Automatic Air Pollution Monitoring and Purification System,” International Journal for Research in Applied Science & Engineering Technology (IJRASET), vol. 9, no. 9, pp. 2321–9653, 2021, doi: 10.22214/ijraset.2021.38039.
T. Nie, G. Zhang, Y. Sun, W. Wang, T. Wang, and H. Duan, “Effects of Indoor Air Quality on Human Physiological Impact: A Review,” Buildings, vol. 15, no. 8, Apr. 2025, doi: 10.3390/buildings15081296.
P. Yushananta, “Very Low-Cost, Internet of Things (IoT) Air Quality Monitoring Platform,” Jurnal Aisyah : Jurnal Ilmu Kesehatan, vol. 8, no. 2, Apr. 2023, doi: 10.30604/jika.v8i2.1919.
M. T. Ilham Ashiddiq, matul Ma, and F. Mayanti, “Prototipe Sistem Pendeteksi Gas dan Api Berbasis Android Prototype of Android-Based Gas and Fire Detector System,” Semnas TE UIN Bandung 2019, pp. 23–24, 2019.
R. Muttaqin, W. Sakti, W. Prayitno, N. E. Setyaningsih, and U. Nurbaiti, “Rancang Bangun Sistem Pemantauan Kualitas Udara Berbasis Iot (Internet Of Things) dengan Sensor DHT11 dan Sensor MQ135,” Jurnal Pengelolaan Laboratorium Pendidikan, vol. 6, no. 2, pp. 2654–251, 2024, doi: https://doi.org/10.14710/jplp.6.2.102-115.
M. Vogt, P. Schneider, N. Castell, and P. Hamer, “Assessment of low-cost particulate matter sensor systems against optical and gravimetric methods in a field co-location in norway,” Atmosphere (Basel), vol. 12, no. 8, Aug. 2021, doi: 10.3390/atmos12080961.
M. Kumar Gajendran, I. Fazil Syed Ahmed Kabir, S. Vadivelu, E. Yin-Kwee Ng, and R. Chandra Thota, “Machine Learning Techniques in Indoor Environmental Quality Assessment,” Advancements in Indoor Environmental Quality and Health, 2023, doi: https://doi.org/10.5772/intechopen.114012.
P. Mottahedin, B. Chahkandi, R. Moezzi, A. M. Fathollahi-Fard, M. Ghandali, and M. Gheibi, “Air quality prediction and control systems using machine learning and adaptive neuro-fuzzy inference system,” Heliyon, vol. 10, no. 21, Nov. 2024, doi: 10.1016/j.heliyon.2024.e39783.
M. M. Rahman et al., “AirNet: predictive machine learning model for air quality forecasting using web interface,” Environmental Systems Research, vol. 13, no. 1, Dec. 2024, doi: 10.1186/s40068-024-00378-z.
N. H. S. Alani, P. Chand, and M. Al-Rawi, “A Two-Stage Machine Learning Framework for Air Quality Prediction in Hamilton, New Zealand,” Environments - MDPI, vol. 12, no. 9, Sep. 2025, doi: 10.3390/environments12090336.
Y. H. Kim and S. H. Moon, “Machine Learning-Based Quality Control for Low-Cost Air Quality Monitoring: A Comprehensive Review of the Past Decade,” Atmosphere (Basel), vol. 16, no. 10, Oct. 2025, doi: 10.3390/atmos16101136.
D. Latoń, J. Grela, A. Ożadowicz, and L. Wisniewski, “Artificial Intelligence and Machine Learning Approaches for Indoor Air Quality Prediction: A Comprehensive Review of Methods and Applications,” Energies (Basel), vol. 18, no. 19, Oct. 2025, doi: 10.3390/en18195194.
R. B. Prototipe, D. Suhu, K. Dan, K. Udara Menggunakan Sensor, S. Surya, and J. Waworundeng, “Design Prototype Detector of Temperature, Humidity, and Air Quality using Sensors, Microcontrollers, Solar Cells, and IoT,” Cogito Smart Journal |, vol. 9, no. 2, 2023.
M. Kumar, G. Mishra, A. Sharma, A. Shaini, and S. Saxena, “Air Quality Monitoring Using MQ135 Gas Sensor and Arduino Uno,” International Journal of Latest Technology in Engineering Management & Applied Science, vol. 14, no. 5, May 2025, doi: 10.51583/IJLTEMAS.
H. Chun and J. Cho, “Missing-value Imputation of Environment Sensors Using Multilayer Stacking with Scoring Method,” IEEE Access, vol. 13, Jun. 2023, doi: 10.21203/rs.3.rs-3050822/v1.
J. M. H. Pinheiro et al., “The Impact of Feature Scaling In Machine Learning: Effects on Regression and Classification Tasks,” IEEE Access, vol. 13, Nov. 2025, doi: 10.1109/ACCESS.2025.3635541.
A. Dzaky and R. Hasudungan, “KLASIFIKASI KUALITAS UDARA BERBASIS IOT DAN ALGORITMA K-NEAREST NEIGHBORS (KNN),” Jurnal Ilmu Komputer dan Sistem Informasi (JIKSI), vol. 11, no. 9, pp. 54–66, 2025.
A. S. Handayani, S. Soim, T. E. Agusdi, and N. L. Husni, “Air Quality Classification Using Support Vector Machine,” Computer Engineering and Applications, vol. 10, no. 1, 2021.
Analyttica Datalab, “What is meant by ‘Stratified Split’? | by Analyttica Datalab | Medium,” https://medium.com/@analyttica/what-is-meant-by-stratified-split-289a8a986a90. Accessed: Dec. 23, 2025. [Online]. Available: https://medium.com/@analyttica/what-is-meant-by-stratified-split-289a8a986a90
A. M. Vélez-Pereira, N. Núñez-Magaña, D. Barreau, K. Bremer, and D. J. O’Connor, “Simplifying Air Quality Forecasting: Logistic Regression for Predicting Particulate Matter in Chile,” Atmosphere (Basel), vol. 16, no. 12, p. 1377, Dec. 2025, doi: 10.3390/atmos16121377.
K. Eldora, E. Fernando, and W. Winanti, “Comparative Analysis of KNN and Decision Tree Classification Algorithms for Early Stroke Prediction: A Machine Learning Approach,” Journal of Information Systems and Informatics, vol. 6, no. 1, pp. 313–338, Mar. 2024, doi: 10.51519/journalisi.v6i1.664.
Nimatul Mamuriyah, Haeruddin Haeruddin, and H. Hero, “PEMBANGUNAN CHATBOT INTERAKTIF DENGAN MENGGUNAKAN ALGORITMA NAIVE BAYES,” Informatika: Jurnal Teknik Informatika dan Multimedia, vol. 4, no. 2, pp. 82–94, Dec. 2024, doi: 10.51903/informatika.v4i2.864.
T. Tan, H. Sama, G. Wijaya, and O. E. Aboagye, “Studi Perbandingan Deteksi Intrusi Jaringan Menggunakan Machine Learning: (Metode SVM dan ANN) Comparative Study of Network Intrusion Detection Using Machine Learning: (SVM and ANN Method),” Jurnal Teknologi dan Informasi, vol. 13, no. 2, 2023, doi: 10.34010/jati.v13i2.
“Memahami Confusion Matrix: Accuracy, Precision, Recall, Specificity, dan F1-Score untuk Evaluasi Model Klasifikasi | by Rina | Medium,” https://esairina.medium.com/memahami-confusion-matrix-accuracy-precision-recall-specificity-dan-f1-score-610d4f0db7cf. Accessed: Dec. 23, 2025. [Online]. Available: https://esairina.medium.com/memahami-confusion-matrix-accuracy-precision-recall-specificity-dan-f1-score-610d4f0db7cf
S. Sathyanarayanan, “Confusion Matrix-Based Performance Evaluation Metrics,” African Journal of Biomedical Research, vol. 27, no. 4, pp. 4023–4031, Nov. 2024, doi: 10.53555/ajbr.v27i4s.4345.
C. Trois, L. D. Del Fabro, and V. A. Baulin, “Machine learning unveils large-scale impact of Posidonia oceanica on Mediterranean Sea water,” Science of the Total Environment, vol. 968, Mar. 2025, doi: 10.1016/j.scitotenv.2025.178802.
Bila bermanfaat silahkan share artikel ini
Berikan Komentar Anda terhadap artikel Analisis Komparasi Algoritma Machine Learning Untuk Klasifikasi Kualitas Udara Indoor Berbasis Sensor Low-Cost
Pages: 588-598
Copyright (c) 2026 Stefanus Eko Prasetyo, Irvan Hansen, Haeruddin Haeruddin

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under Creative Commons Attribution 4.0 International License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (Refer to The Effect of Open Access).






















