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

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.

Authors

Institutions

Publication Details

Journal
Jurnal Nasional Pendidikan Teknik Informatika (JANAPATI)
Published
2025-12-22
DOI
https://doi.org/10.23887/janapati.v14i3.94433
Primary Topic
Stock Market Forecasting Methods
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

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

Philipus Suryo Subandoro, Devi Dwi Purwanto, Agustinus Bimo Gumelar
Jurnal Nasional Pendidikan Teknik Informatika (JANAPATI)
Stock Market Forecasting Methods
article

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

Philipus Suryo Subandoro, Devi Dwi Purwanto, Agustinus Bimo Gumelar
article en

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.

Jurnal Nasional Pendidikan Teknik Informatika (JANAPATI)Vol. 14(3)
Universitas Katolik Widya Mandala Surabaya (ID), Universitas Ciputra (ID)
Industry, innovation and infrastructure
Openalex Percentile: Top 29%
Stock Market Forecasting Methods
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.