An integrated approach to demand forecasting and inventory optimization in e-commerce

Authors:
Abstract:

This study investigates demand forecasting and inventory optimization in an e-commerce environment with a large assortment of products and highly variable demand. The research focuses on SKU-level demand modeling based on transactional data from an online retail store. The proposed approach combines machine learning methods with a stochastic inventory model. Demand forecasting is performed using regression-based and ensemble models with engineered temporal features, including calendar variables, lagged values, and rolling statistics. Demand uncertainty is estimated based on forecasting errors and adjusted using a robust capping procedure. The results show that the gradient boosting model provides the highest forecasting accuracy (MAE = 23.97, RMSE = 311.70). The average weekly demand across products is approximately 158 units, while demand variability differs significantly between SKUs. The application of the Newsvendor model leads to an average optimal order quantity of 236 units, which reflects the impact of demand uncertainty on safety stock formation. However, unconstrained solutions exceed the available budget by more than 14 times. To address this issue, a budget constraint is incorporated, and a proportional scaling procedure is applied. As a result, the average order size is reduced to 16 units, and the total procurement cost (119.3 thousand monetary units) satisfies the budget constraint (122.8 thousand). The achieved service level is approximately 0.94. The study demonstrates that integrating machine learning forecasting with stochastic inventory optimization provides an effective decision-support tool for e-commerce, enabling balanced consideration of demand uncertainty, service level, and financial constraints.