Jurnal Nasional Pendidikan Teknik Informatika (JANAPATI)
Vol. 14 No. 3 (2025)

Optimizing Stock Prediction in Supermarket: A Comparative Analysis of LightGBM and XGBoost for Enhanced Inventory Management

Devi Dwi Purwanto (Department of Informatics, Faculty of Engineering, Widya Mandala Surabaya Catholic University, Indonesia)
Philipus Suryo Subandoro (Department of Informatics, Faculty of Engineering, Widya Mandala Surabaya Catholic University, Indonesia)
Agustinus Bimo Gumelar (Department of Informatics, School of Information Technology, Universitas Ciputra, Indonesia)



Article Info

Publish Date
22 Dec 2025

Abstract

Stock management in supermarkets is a critical challenge due to unpredictable demand fluctuations and seasonal purchasing patterns. Inaccurate forecasting often leads to understocking or overstocking, which in turn reduces customer satisfaction and causes financial losses. To overcome this problem, machine learning approaches have gained attention for their ability to model complex patterns in sales data more effectively than traditional methods. This study compares two widely used algorithms, XGBoost and LightGBM, in forecasting daily supermarket sales. A dataset of 23,873 transactions from January 2023 to December 2024 was used, processed into daily sales per product, and enriched with seasonal and lag features. Hyperparameter tuning was conducted using GridSearchCV and RandomizedSearchCV, and model evaluation applied multiple metrics including MAE, MAPE, RMSE, and MSE. The results indicate that XGBoost outperformed LightGBM, achieving the lowest MAE of 2.413×10⁻⁵ after optimization. While LightGBM demonstrated computational efficiency, its accuracy was less optimal for this dataset. These findings highlight the superiority of XGBoost for small- to medium-scale retail time series forecasting and provide practical insights for supermarkets to enhance inventory management and supplier coordination.

Copyrights © 2025






Journal Info

Abbrev

janapati

Publisher

Subject

Computer Science & IT Education Engineering

Description

Jurnal Nasional Pendidikan Teknik Informatika (JANAPATI) is a collection of scientific articles in the field of Informatics / ICT Education widely and the field of Information Technology, published and managed by Jurusan Pendidikan Teknik Informatika, Fakultas Teknik dan Kejuruan, Universitas ...