Development of a Time Series E-Commerce Sales Prediction Method for Short-Shelf-Life Products Using GRU-LightGBM
Abstract
:1. Introduction
2. Literature Review of Sales Prediction Methods
3. Methodology
3.1. Research Premise
3.2. Research Approach
3.3. Data Processing Methods
3.3.1. Data Preprocessing
- (1)
- One-hot. The categorical features are one-hot encoded because numeric coding will cause a large number of errors in this work.
- (2)
- Standardization. In this work, maximum and minimum standardization are used to map the initial data to the interval [0, 1].
- (3)
- Missing value processing. In this work, the regression tree model is used to fill in the missing values.
- (4)
- Outlier handling. The data set is constructed using the sliding window method [34]. Then, we calculate the mean and standard deviation and determine the data outside the range of three standard deviations from the mean as outliers. The outliers are handled as missing values.
3.3.2. The STL Method
3.3.3. Feature Selection Using REFCV
Algorithm 1: RFE algorithm—Pseudo-code for the RFE algorithm |
Inputs: Training set , Set of features , Ranking method |
Outputs: Final ranking 1: for in (1: ) do 2: Rank set using 3: last ranked feature in 4: 5: 6: end for |
3.4. The Development of GRU-LightGBM
3.4.1. The GRU Method
3.4.2. The LightGBM Method
3.4.3. Harmonization of GRU-LightGBM
4. Application Using GRU-LightGBM for Sales Prediction
4.1. Background of the Case Study
4.2. STL Analysis
4.3. Result of Feature Selection
4.4. Result of Sales Prediction Using GRU-LightGBM
5. Discussion and Conclusions
5.1. Comparison with Other Prediction Methods
5.2. Contribution of the Work
5.3. Limitations of the Work
5.4. Opportunities
5.5. Conclusions
Author Contributions
Funding
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Gammon, K. Experimenting with blockchain: Can one technology boost both data integrity and patients’ pocketbooks? Nat. Med. 2018, 24, 378–381. [Google Scholar] [CrossRef] [PubMed]
- Peng, X.; Li, X.; Yang, X. Analysis of circular economy of E-commerce market based on grey model under the background of big data. J. Enterp. Inf. Manag. 2022, 35, 1148–1167. [Google Scholar] [CrossRef]
- Zhang, X.; Guo, F.; Chen, T.; Pan, L.; Beliakov, G.; Wu, J. A Brief Survey of Machine Learning and Deep Learning Techniques for E-Commerce Research. J. Theor. Appl. Electron. Commer. Res. 2023, 18, 2188–2216. [Google Scholar] [CrossRef]
- Rasim; Junaeti, E.; Wirantika, R. Implementation of Automatic Clustering Algorithm and Fuzzy Time Series in Motorcycle Sales Forecasting. IOP Conf. Ser. Mater. Sci. Eng. 2018, 288, 012126. [Google Scholar] [CrossRef]
- Dinçoğlu, P.; Aygün, H. Comparison of Forecasting Algorithms on Retail Data. In Proceedings of the 2022 10th International Symposium on Digital Forensics and Security (ISDFS), Istanbul, Turkey, 6–7 June 2022. [Google Scholar]
- Hewage, H.C.; Perera, H.N. Comparing Statistical and Machine Learning Methods for Sales Forecasting During the Post-promotional Period. In Proceedings of the 2021 IEEE International Conference on Industrial Engineering and Engineering Management (IEEM), Singapore, 13–16 December 2021. [Google Scholar]
- Dairu, X.; Shilong, Z. Machine Learning Model for Sales Forecasting by Using XGBoost. In Proceedings of the 2021 IEEE International Conference on Consumer Electronics and Computer Engineering (ICCECE), Guangzhou, China, 15–17 January 2021. [Google Scholar]
- Tang, Y.M.; Chau, K.Y.; Lau, Y.-Y.; Zheng, Z. Data-Intensive Inventory Forecasting with Artificial Intelligence Models for Cross-Border E-Commerce Service Automation. Appl. Sci. 2023, 13, 3051. [Google Scholar] [CrossRef]
- Lashgari, Y.S.; Shahab, S. The Impact of the COVID-19 Pandemic on Retail in City Centres. Sustainability 2022, 14, 11463. [Google Scholar] [CrossRef]
- Pongdatu, G.A.N.; Putra, Y.H. Seasonal Time Series Forecasting using SARIMA and Holt Winter’s Exponential Smoothing. IOP Conf. Ser. Mater. Sci. Eng. 2018, 407, 012153. [Google Scholar] [CrossRef]
- Sidqi, F.; Sumitra, I.D. Forecasting Product Selling Using Single Exponential Smoothing and Double Exponential Smoothing Methods. IOP Conf. Ser. Mater. Sci. Eng. 2019, 662, 032031. [Google Scholar] [CrossRef]
- Bergmeir, C.; Hyndman, R.J.; Benítez, J.M. Bagging exponential smoothing methods using STL decomposition and Box–Cox transformation. Int. J. Forecast. 2016, 32, 303–312. [Google Scholar] [CrossRef]
- Contreras, J.; Espinola, R.; Nogales, F.; Conejo, A. ARIMA models to predict next-day electricity prices. IEEE Trans. Power Syst. 2003, 18, 1014–1020. [Google Scholar] [CrossRef]
- Wang, S.-J.; Huang, C.-T.; Wang, W.-L.; Chen, Y.-H. Incorporating ARIMA forecasting and service-level based replenishment in RFID-enabled supply chain. Int. J. Prod. Res. 2010, 48, 2655–2677. [Google Scholar] [CrossRef]
- Babai, M.; Ali, M.; Boylan, J.; Syntetos, A. Forecasting and inventory performance in a two-stage supply chain with ARIMA(0,1,1) demand: Theory and empirical analysis. Int. J. Prod. Econ. 2013, 143, 463–471. [Google Scholar] [CrossRef]
- Biswas, A.K.; Ahmed, S.I.; Bankefa, T.; Ranganathan, P.; Salehfar, H. Performance Analysis of Short and Mid-Term Wind Power Prediction using ARIMA and Hybrid Models. In Proceedings of the 2021 IEEE Power and Energy Conference at Illinois (PECI), Champaign, IL, USA, 1–2 April 2021. [Google Scholar]
- Bi, J.; Wang, Y.; Sun, S.; Guan, W. Predicting Charging Time of Battery Electric Vehicles Based on Regression and Time-Series Methods: A Case Study of Beijing. Energies 2018, 11, 1040. [Google Scholar] [CrossRef]
- Tsoumakas, G. A survey of machine learning techniques for food sales prediction. Artif. Intell. Rev. 2019, 52, 441–447. [Google Scholar] [CrossRef]
- Li, Q.; Yu, M. Achieving Sales Forecasting with Higher Accuracy and Efficiency: A New Model Based on Modified Transformer. J. Theor. Appl. Electron. Commer. Res. 2023, 18, 1990–2006. [Google Scholar] [CrossRef]
- Xia, Z.; Xue, S.; Wu, L.; Sun, J.; Chen, Y.; Zhang, R. ForeXGBoost: Passenger car sales prediction based on XGBoost. Distrib. Parallel Databases 2020, 38, 713–738. [Google Scholar] [CrossRef]
- Bi, X.; Adomavicius, G.; Li, W.; Qu, A. Improving Sales Forecasting Accuracy: A Tensor Factorization Approach with Demand Awareness. INFORMS J. Comput. 2022, 34, 1644–1660. [Google Scholar] [CrossRef]
- Hwang, S.; Yoon, G.; Baek, E.; Jeon, B.-K. A Sales Forecasting Model for New-Released and Short-Term Product: A Case Study of Mobile Phones. Electronics 2023, 12, 3256. [Google Scholar] [CrossRef]
- Chaudhuri, K.D.; Alkan, B. A hybrid extreme learning machine model with harris hawks optimisation algorithm: An optimised model for product demand forecasting applications. Appl. Intell. 2022, 52, 11489–11505. [Google Scholar] [CrossRef]
- Zhang, B.; Tseng, M.-L.; Qi, L.; Guo, Y.; Wang, C.-H. A comparative online sales forecasting analysis: Data mining techniques. Comput. Ind. Eng. 2023, 176, 108935. [Google Scholar] [CrossRef]
- Kuo, R.J.; Tseng, Y.S.; Chen, Z.-Y. Integration of fuzzy neural network and artificial immune system-based back-propagation neural network for sales forecasting using qualitative and quantitative data. J. Intell. Manuf. 2016, 27, 1191–1207. [Google Scholar] [CrossRef]
- Ma, S.; Fildes, R. Retail sales forecasting with meta-learning. Eur. J. Oper. Res. 2021, 288, 111–128. [Google Scholar] [CrossRef]
- Yu, Q.; Wang, K.; Strandhagen, J.O.; Wang, Y. Application of Long Short-Term Memory Neural Network to Sales Forecasting in Retail—A Case Study. In Advanced Manufacturing and Automation VII; Springer: Singapore, 2018. [Google Scholar]
- Saha, P.; Gudheniya, N.; Mitra, R.; Das, D.; Narayana, S.; Tiwari, M.K. Demand Forecasting of a Multinational Retail Company using Deep Learning Frameworks. IFAC-PapersOnLine 2022, 55, 395–399. [Google Scholar] [CrossRef]
- Zhu, B.; Dong, H.; Zhang, J. Car Sales Prediction Using Gated Recurrent Units Neural Networks with Reinforcement Learning. In Intelligence Science and Big Data Engineering. Big Data and Machine Learning; Springer International Publishing: Cham, Switzerland, 2019. [Google Scholar]
- Ou-Yang, C.; Chou, S.-C.; Juan, Y.-C. Improving the Forecasting Performance of Taiwan Car Sales Movement Direction Using Online Sentiment Data and CNN-LSTM Model. Appl. Sci. 2022, 12, 1550. [Google Scholar] [CrossRef]
- Choi, T.-M.; Hui, C.-L.; Liu, N.; Ng, S.-F.; Yu, Y. Fast fashion sales forecasting with limited data and time. Decis. Support Syst. 2014, 59, 84–92. [Google Scholar] [CrossRef]
- Khandelwal, I.; Adhikari, R.; Verma, G. Time Series Forecasting Using Hybrid ARIMA and ANN Models Based on DWT Decomposition. Procedia Comput. Sci. 2015, 48, 173–179. [Google Scholar] [CrossRef]
- Han, Y. A forecasting method of pharmaceutical sales based on ARIMA-LSTM model. In Proceedings of the 2020 5th International Conference on Information Science, Computer Technology and Transportation (ISCTT), Shenyang, China, 13–15 November 2020. [Google Scholar]
- Dong, L.; Fang, D.; Wang, X.; Wei, W.; Damaševičius, R.; Scherer, R.; Woźniak, M. Prediction of Streamflow Based on Dynamic Sliding Window LSTM. Water 2020, 12, 3032. [Google Scholar] [CrossRef]
- He, H.; Gao, S.; Jin, T.; Sato, S.; Zhang, X. A seasonal-trend decomposition-based dendritic neuron model for financial time series prediction. Appl. Soft Comput. 2021, 108, 107488. [Google Scholar] [CrossRef]
- Mohsin, A.; Hongzhen, L.; Iqbal, M.M.; Salim, Z.R.; Hossain, A.; Al Kafy, A. Forecasting e-waste recovery scale driven by seasonal data characteristics: A decomposition-ensemble approach. Waste Manag. Res. 2021, 40, 870–881. [Google Scholar] [CrossRef]
- Carbo-Bustinza, N.; Iftikhar, H.; Belmonte, M.; Cabello-Torres, R.J.; De La Cruz, A.R.H.; López-Gonzales, J.L. Short-Term Forecasting of Ozone Concentration in Metropolitan Lima Using Hybrid Combinations of Time Series Models. Appl. Sci. 2023, 13, 10514. [Google Scholar] [CrossRef]
- Qin, L.; Li, W.; Li, S. Effective passenger flow forecasting using STL and ESN based on two improvement strategies. Neurocomputing 2019, 356, 244–256. [Google Scholar] [CrossRef]
- Lin, C.; Weng, K.; Lin, Y.; Zhang, T.; He, Q.; Su, Y. Time Series Prediction of Dam Deformation Using a Hybrid STL–CNN–GRU Model Based on Sparrow Search Algorithm Optimization. Appl. Sci. 2022, 12, 11951. [Google Scholar] [CrossRef]
- Yadav, N.S.; Sharma, V.P.; Reddy, D.S.D.; Mishra, S. An Effective Network Intrusion Detection System Using Recursive Feature Elimination Technique. Eng. Proc. 2023, 59, 99. [Google Scholar] [CrossRef]
- Lu, Y.; Fan, X.; Zhao, Z.; Jiang, X. Dynamic Fire Risk Classification Prediction of Stadiums: Multi-Dimensional Machine Learning Analysis Based on Intelligent Perception. Appl. Sci. 2022, 12, 6607. [Google Scholar] [CrossRef]
- Cho, K.; van Merriënboer, B.; Gulcehre, C.; Bahdanau, D.; Bougares, F.; Schwenk, H.; Bengio, Y. Learning phrase representations using RNN encoder-decoder for statistical machine translation. arXiv 2014, arXiv:1406.1078. [Google Scholar]
- Li, S.; Zou, Y.; Shi, Z.; Tian, J.; Li, W. Performance enhancement of CAP-VLC system utilizing GRU neural network based equalizer. Opt. Commun. 2023, 528, 129062. [Google Scholar] [CrossRef]
- Ke, G.; Meng, Q.; Finley, T.; Wang, T.; Chen, W.; Ma, W.; Ye, Q.; Liu, T. Lightgbm: A highly efficient gradient boosting decision tree. Adv. Neural Inf. Process. Syst. 2017, 30. [Google Scholar]
- Wei, J.; Li, Z.; Pinker, R.T.; Wang, J.; Sun, L.; Xue, W.; Li, R.; Cribb, M. Himawari-8-derived diurnal variations in ground-level PM2.5 pollution across China using the fast space-time Light Gradient Boosting Machine (LightGBM). Atmos. Chem. Phys. 2021, 21, 7863–7880. [Google Scholar] [CrossRef]
- Sun, X.; Liu, M.; Sima, Z. A novel cryptocurrency price trend forecasting model based on LightGBM. Financ. Res. Lett. 2020, 32, 101084. [Google Scholar] [CrossRef]
- Ju, Y.; Sun, G.; Chen, Q.; Zhang, M.; Zhu, H.; Rehman, M.U. A Model Combining Convolutional Neural Network and LightGBM Algorithm for Ultra-Short-Term Wind Power Forecasting. IEEE Access 2019, 7, 28309–28318. [Google Scholar] [CrossRef]
- Corp, M. Parameters-LightGBM 3.3.5.99 Documentation. 2023. Available online: https://lightgbm.readthedocs.io/en/latest/Parameters.html (accessed on 6 December 2023).
- Pavlyshenko, B. Using Stacking Approaches for Machine Learning Models. In Proceedings of the 2018 IEEE Second International Conference on Data Stream Mining & Processing (DSMP), Lviv, Ukraine, 21–25 August 2018. [Google Scholar]
- Gajewski, P.; Čule, B.; Rankovic, N. Unveiling the Power of ARIMA, Support Vector and Random Forest Regressors for the Future of the Dutch Employment Market. J. Theor. Appl. Electron. Commer. Res. 2023, 18, 1365–1403. [Google Scholar] [CrossRef]
- Zhang, W.; Lin, Z.; Liu, X. Short-term offshore wind power forecasting—A hybrid model based on Discrete Wavelet Transform (DWT), Seasonal Autoregressive Integrated Moving Average (SARIMA), and deep-learning-based Long Short-Term Memory (LSTM). Renew. Energy 2022, 185, 611–628. [Google Scholar] [CrossRef]
- Zhao, Z.; Wu, C. Wheat Quantity Monitoring Methods Based on Inventory Measurement and SVR Prediction Model. Appl. Sci. 2023, 13, 12745. [Google Scholar] [CrossRef]
- Wu, D.; Jia, Z.; Zhang, Y.; Wang, J. Predicting Temperature and Humidity in Roadway with Water Trickling Using Principal Component Analysis-Long Short-Term Memory-Genetic Algorithm Method. Appl. Sci. 2023, 13, 13343. [Google Scholar] [CrossRef]
- Wang, W.; Zhang, Z.; Wang, L.; Zhang, X.; Zhang, Z. Mixed-frequency data-driven forecasting the important economies’ performance in a smart city: A novel RUMIDAS-SVR model. Ind. Manag. Data Syst. 2022, 122, 2175–2198. [Google Scholar] [CrossRef]
- Shankar, S.; Ilavarasan, P.V.; Punia, S.; Singh, S.P. Forecasting container throughput with long short-term memory networks. Ind. Manag. Data Syst. 2020, 120, 425–441. [Google Scholar] [CrossRef]
- Karunasingha, D.S.K. Root mean square error or mean absolute error? Use their ratio as well. Inf. Sci. 2022, 585, 609–629. [Google Scholar] [CrossRef]
Sequence | Description |
---|---|
Step 1—Raw data collection | Use marketing data tools or data crawlers to collect the sales volume data. |
Step 2—Data processing |
|
Step 3—Prediction using GRU-LightGBM | The prediction model is a stacking model developed based on the integration of GRU and LightGBM. GRU is used to extract trends and fluctuations in time series data and LightGBM is used to solve multivariable problems. |
Step 4—Prediction output analysis | Deliver prediction outputs and generate sales strategies for organization. |
Step Number | Activity |
---|---|
Step 1: Detrending | Remove the trend component of the th iteration from , i.e., . |
Step 2: Cycle subseries smoothing | Each cycle subseries is smoothed via loess and the smoothing results compose the temporary season series . |
Step 3: Low-pass filtering of cycle subseries | Low-pass filtering and loess regression are used to handle the temporary season series . The resulting series is referred to as . |
Step 5: Deseasonalization | The seasonal component of the ()th iteration is calculated as . |
Step 6: Trend smoothing | To obtain the trend component of the ()th iteration , the output of Step 5 is smoothed via loess. |
Parameter | Interpretation |
---|---|
max_depth | The max depth of the tree model. |
min_data_in_leaf | The minimum amount of data in one leaf. |
feature_fraction | The fraction of features selected randomly in each iteration for each tree. |
bagging_fraction | The fraction of data selected randomly for each iteration without resampling. |
learning_rate | The shrinkage rates. In dart, it also affects the normalization weights of dropped trees. |
num_leaves | The max number of leaves in one tree. |
Analysis Aspects | Results |
---|---|
Long-term trend | The sales volume is increasing. |
Periodic trend | There is annual periodicity, but it fluctuates greatly. The peaks always occur in June and November, and the trough always occurs in March. |
Random disturbance | The peaks of sales show significant random disturbances. |
Overall | Significant fluctuations and uncertainty. |
Class | Feature |
---|---|
Product time-varying features | Sales volume, active price, Baidu index |
Platform activity features | Activity period, activity heat, activity stage, activity first day |
Advertising features | Brand zone, through train, drill show, brand special show, Youku |
Content operation features | Master live, brand live, Juhuasuan, Taobao short video, micro tao |
Periodic features | Weeks, holidays, months |
Statistics features | Average daily sales volume (3 days), average daily sales volume (7 days), average activity price (3 days), average activity price (7 days), average Baidu index (3 days), average Baidu index (7 days) |
Parameter | Value | Parameter | Value |
---|---|---|---|
boosting | gbdt | min_data_in_leaf | 11 |
application | regression | max_bin | 175 |
metric | mse | feature_fraction | 0.8 |
learning_rate | 0.05 | bagging_fraction | 0.6 |
n_estimators | 122 | bagging_freq | 20 |
max_depth | 6 | reg_lambda | 0.001 |
num_leaves | 18 | reg_alpha | 0.01 |
Method | Advantages | Disadvantages |
---|---|---|
ARIMA | Performs well in short-term prediction. Only the prior data are needed. | Cannot capture the nonlinear relationships in sales. |
Seasonal ARIMA | SARIMA is a type of ARIMA model that performs well when dealing with seasonally affected time series data. | There are shortcomings in dealing with time series that have periodicity. |
SVR | SVR can execute linear and nonlinear regressions with a high degree of accuracy by utilizing various kernel functions [54]. | Poor interpretation can be found when solving nonlinear problems. Weak in handling large datasets. |
LightGBM | LightGBM is efficient and robust. | The accuracy of prediction is inferior to that of deep learning methods such as LSTM and GRU. |
LSTM | LSTM is addressed to tackle the problem of gradient vanishing and explosion in the process of long sequence calculation and has the capacity for long-term memory [55]. | It has a slow training speed. |
GRU | Same as LSTM. GRU is the lightweight implementation of LSTM. | It has a slow training speed. |
Model | RMSE | MAE | MAPE |
---|---|---|---|
ARIMA | 20.77 | 16.27 | 8.41% |
Seasonal ARIMA | 13.35 | 10.44 | 7.48% |
SVR | 13.26 | 10.16 | 6.94% |
LightGBM | 12.11 | 10.21 | 6.60% |
LSTM | 11.81 | 9.03 | 5.87% |
GRU | 11.19 | 8.76 | 5.74% |
GRU-LightGBM | 8.01 | 5.41 | 4.11% |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Chen, Y.; Xie, X.; Pei, Z.; Yi, W.; Wang, C.; Zhang, W.; Ji, Z. Development of a Time Series E-Commerce Sales Prediction Method for Short-Shelf-Life Products Using GRU-LightGBM. Appl. Sci. 2024, 14, 866. https://doi.org/10.3390/app14020866
Chen Y, Xie X, Pei Z, Yi W, Wang C, Zhang W, Ji Z. Development of a Time Series E-Commerce Sales Prediction Method for Short-Shelf-Life Products Using GRU-LightGBM. Applied Sciences. 2024; 14(2):866. https://doi.org/10.3390/app14020866
Chicago/Turabian StyleChen, Yong, Xian Xie, Zhi Pei, Wenchao Yi, Cheng Wang, Wenzhu Zhang, and Zuzhen Ji. 2024. "Development of a Time Series E-Commerce Sales Prediction Method for Short-Shelf-Life Products Using GRU-LightGBM" Applied Sciences 14, no. 2: 866. https://doi.org/10.3390/app14020866
APA StyleChen, Y., Xie, X., Pei, Z., Yi, W., Wang, C., Zhang, W., & Ji, Z. (2024). Development of a Time Series E-Commerce Sales Prediction Method for Short-Shelf-Life Products Using GRU-LightGBM. Applied Sciences, 14(2), 866. https://doi.org/10.3390/app14020866