Journal of Applied Computer Science and Technology (JACOST)
Vol. 7 No. 1 (2026): Juni 2026 (In progress)

A Comparative Study of Random Forest, K-Nearest Neighbors, and XGBoost Models for Weather-Aware Smart Office Building Automation

Erwin Yonata (Universitas Sampoerna)
Maya Anggun Beer (Universitas Sampoerna)
Ni Nyoman Putri Shopia (Universitas Sampoerna)
Emilia Loho (Universitas Sampoerna)
Gilang Raka Rayuda Dewa (Universitas Sampoerna)



Article Info

Publish Date
28 May 2026

Abstract

The intelligent control of lighting and HVAC systems plays a critical role in reducing energy consumption in smart buildings. However, many existing automation systems rely on static scheduling strategies that fail to adapt to dynamic environmental conditions. Although machine learning has been widely applied to weather-based building automation, inconsistent feature selection, model configuration, and evaluation procedures limit the validity of comparative performance claims. This study aims to develop and evaluate a machine-learning-based weather classification framework for smart building automation. The proposed methodology follows a structured pipeline comprising data acquisition and preprocessing, model training and testing, parameter tuning, and performance evaluation. A publicly available Weather Type Classification dataset is used, consisting of numerical weather parameters, which are encoded prior to training. Feature selection is applied to identify the most influential predictors. Three machine learning models, Random Forest, K Nearest Neighbors, and XGBoost, are trained using an 80:20 stratified split, with hyperparameters optimized through grid search to ensure an optimized model. Model performance is evaluated using accuracy, precision, recall, F1 score, and a confusion matrix. Experimental results demonstrate that Random Forest achieves the highest accuracy of 97.50 percent, followed by XGBoost at 96.90 percent and K Nearest Neighbors at 95.73 percent, with balanced performance across all weather categories. The findings indicate that ensemble-based classifiers are well-suited for robust weather recognition. The classified weather outputs can be directly mapped to real-time control strategies for lighting and HVAC systems, enabling adaptive automation and improved energy efficiency in smart buildings.

Copyrights © 2026






Journal Info

Abbrev

JACOST

Publisher

Subject

Computer Science & IT

Description

Fokus dan Ruang Lingkup Journal of Applied Computer Science and Technology (JACOST) dimaksudkan sebagai media kajian ilmiah hasil penelitian, pemikiran dan kajian analisis-kritis mengenai penelitian bidang ilmu komputer dan teknologi. Sebagai bagian dari semangat menyebarluaskan ilmu pengetahuan ...