Source-linked AI summary

Sales Demand Forecast in E-commerce using a Long Short-Term Memory Neural Network Methodology

Kasun Bandara, Peibei Shi, Christoph Bergmeir, Hansika Hewamalage, Quoc Tran, Brian Seaman

arXiv:1901.04028v2cs.LGstat.ML

TL;DR

E-commerce demand forecasting often relies on univariate product histories, despite related products exhibiting correlated sales patterns. This paper globally trains LSTM models using cross-series information, systematic preprocessing, and product grouping strategies, achieving competitive results and outperforming state-of-the-art univariate techniques on Walmart.com datasets.

  • Problem

    Univariate forecasts use only a single product’s historical sales, motivating models that exploit correlated sales patterns across related products in E-commerce assortments.

  • Method

    The framework globally trains LSTM models across product-assortment hierarchies, adds systematic preprocessing, and uses grouping strategies for disparate or sparse sales patterns.

  • Results

    The methods outperformed state-of-the-art univariate forecasting techniques on category-level and super-department-level Walmart.com datasets.

  • Takeaways & Limitations

    Grouping strategies uplift baseline LSTM performance and are particularly useful when product sales are sparse.

Abstract

from arXiv · show

Generating accurate and reliable sales forecasts is crucial in the E-commerce business. The current state-of-the-art techniques are typically univariate methods, which produce forecasts considering only the historical sales data of a single product. However, in a situation where large quantities of related time series are available, conditioning the forecast of an individual time series on past behaviour of similar, related time series can be beneficial. Since the product assortment hierarchy in an E-commerce platform contains large numbers of related products, in which the sales demand patterns can be correlated, our attempt is to incorporate this cross-series information in a unified model. We achieve this by globally training a Long Short-Term Memory network (LSTM) that exploits the non-linear demand relationships available in an E-commerce product assortment hierarchy. Aside from the forecasting framework, we also propose a systematic pre-processing framework to overcome the challenges in the E-commerce business. We also introduce several product grouping strategies to supplement the LSTM learning schemes, in situations where sales patterns in a product portfolio are disparate. We empirically evaluate the proposed forecasting framework on a real-world online marketplace dataset from Walmart.com. Our method achieves competitive results on category level and super-departmental level datasets, outperforming state-of-the-art techniques.

1 Introduction

E-commerce demand forecasting is important but difficult because sales data are volatile, sparse, and shaped by related products within hierarchical assortments. The paper addresses these challenges with a globally trained LSTM, preprocessing framework, grouping strategies, and empirical evaluation on Walmart.com data.

  • Accurate product-level demand forecasts support inventory planning, competitive pricing, and promotion planning, while poor estimates can be costly.
  • E-commerce demand data are difficult to model because holiday effects, competition, non-stationarity, irregular patterns, sparsity, and intermittency affect sales.
  • Traditional exponential-smoothing and ARIMA methods forecast each product separately, ignoring cross-series information from related products.
  • The study exploits sales correlations in product hierarchies through a globally trained LSTM framework.
  • The framework adds systematic preprocessing, compares two LSTM learning schemes, incorporates static and dynamic features, and evaluates real-world retail sales data.

2 Problem Statement

The paper formulates product-demand forecasting as a global prediction problem that uses historical sales from all products and exogenous features to forecast future demand for one product.

  • For product i, historical sales are represented as Xi, with K observations, while exogenous features Zi have dimension K×P.
  • The prediction model f uses sales histories from all n products, together with the exogenous feature set, to forecast product i.
  • The forecast contains M future sales-demand points, where M is the forecasting horizon.
  • The model parameters θ are learned during LSTM training.

3 Prior Work

Prior work largely used univariate statistical or neural forecasting, whereas newer global approaches model related time series jointly to exploit shared information and address limited or heterogeneous data.

  • Traditional E-commerce forecasting methods are strongly influenced by exponential smoothing and ARIMA, while sales data remain irregular, bursty, and sparse.
  • Many neural-network studies also use univariate forecasting, leaving cross-series information unused.
  • Multiple related time series can potentially improve robustness to outliers by reducing the influence of abnormal observations in one series.
  • Global models have improved promotional forecasting with limited histories and used hierarchical information to disseminate cross-series signals.
  • RNN, LSTM, Bayesian, and clustering-based frameworks have modeled groups of time series for probabilistic forecasting or heterogeneous portfolios.
  • Global learning has been reported to improve robustness and forecasting accuracy while helping models learn from shorter time series.

4 Data Preprocessing

The preprocessing framework addresses E-commerce data-quality and heterogeneity challenges by cleaning sales records, grouping related products, normalizing demand, and converting series into LSTM training windows.

  • Data quality: The framework treats suspected ETL-generated “fake zeros” as missing observations, while acknowledging that unavailable zero-sales ground truth can produce false positives.
  • Data quality: Forward filling replaces missing sales with the most recent valid observation and outperformed linear regression and CART in preliminary experiments.
  • Product grouping: Products are grouped using either business metrics—sales ranking and zero-sales density—or K-means clustering over sales-related and time-series features.
  • Sales normalization: Mean-scale normalization uses each product’s mean sales as its scaling factor before global modeling.
  • Moving Window approach: The Moving Window strategy creates input-output patches, with output-window size m matching the forecasting horizon for direct multi-step prediction.
  • Moving Window approach: At each Moving Window step, the input-window mean is subtracted from corresponding input and output values to reduce activation saturation effects.

5 LSTM Network Architecture

The architecture uses peephole-connected LSTMs trained on lagged windows, with alternative back-propagation error schemes and static and dynamic features incorporated into the input.

  • LSTM architecture: Peephole-connected LSTMs let the input and forget gates incorporate the previous memory-cell state.
  • Input representation: The network receives arrays of lagged values from Moving Window data rather than single observations, allowing learning directly from lagged time series.
  • Network architecture: Each LSTM layer is followed by a fully connected layer that projects the hidden state to the output-window dimension.
  • Learning schemes: LSTM-LS1 accumulates prediction errors across LSTM cell instances, whereas LSTM-LS2 uses only the final cell’s error for back-propagation through time.
  • Exogenous variables: Static product information and dynamic calendar features are combined with historical sales in the input window, with categorical variables one-hot encoded.

6 Overall procedure

The forecasting framework consists of preprocessing, LSTM training, and post-processing components that transform raw sales data into forecasts on the original sales scale.

  • Framework components: The framework comprises a pre-processing layer, an LSTM training layer, and a post-processing layer.
  • Forecast generation: After preprocessing, the models are trained with LSTM-LS1 and LSTM-LS2, and their predictions are rescaled and denormalized to obtain final forecasts.
  • Forecast generation: Rescaling returns forecasts to the original sales scale, while denormalization adds back the mean sales of the last input window.

7 Experiments

The framework is evaluated on Walmart.com datasets using mMAPE and multiple LSTM variants, grouping strategies, optimization settings, and univariate benchmarks. Results show that grouped LSTM variants are competitive across category- and super-department-level settings, especially for business-impactful and sparse product groups.

  • Datasets: The experiments use Walmart.com data covering 1,724 household items and 18,254 products from a single super-department.The household dataset contains 15 sub-categories, while the super-department dataset contains 16 categories.
  • Error measure: The evaluation uses modified mean absolute percentage error, reported as both the mean and median across items.The median is used to summarize error distributions when many observations contain zero sales.
  • Methods: The study compares globally trained, subgroup-specific, feature-augmented, and cluster-based LSTM variants against EWMA, ETS, ARIMA, and naïve forecasts.The LSTM experiments vary learning schemes, hyper-parameter selection methods, and optimization algorithms.
  • Category-level results: In the category-level dataset, LSTM.CLUSTER achieves the best Mean mMAPE overall, while the Naïve forecast achieves the best Median mMAPE.For G1, LSTM.CLUSTER and LSTM.GROUP outperform the other benchmarks on Mean mMAPE and Median mMAPE, respectively.
  • Super-department results: In the super-department dataset, LSTM.GROUP generally gives the best Mean mMAPE, while the Naïve forecast ranks first in Median mMAPE.LSTM.GROUP outperforms LSTM.ALL in G1, while LSTM variants and the Naïve forecast perform best on average in sparse G2 and G3 groups.
  • Overall findings: Most LSTM variants show competitive results across both evaluation settings, and grouping strategies improve the baseline LSTM performance.The reported results are described as robust when applied to large numbers of items.

8 Conclusions

The paper proposes a global LSTM forecasting framework that uses cross-product demand relationships and systematic product grouping. Evaluated on Walmart.com category- and super-department-level datasets, the methods outperform state-of-the-art univariate forecasting techniques.

  • Motivation: The framework addresses sales forecasting by exploiting correlated demand patterns across products in an e-commerce product hierarchy.It is designed to use non-linear relationships among related product time series.
  • Method: The proposed approach globally trains an LSTM across product-assortment items and supplements it with grouping strategies for sparse sales patterns.The grouping strategies are presented as additions to the base model.
  • Results: Evaluated on real-world Walmart.com data at category and super-department levels, the methods outperform state-of-the-art univariate forecasting techniques.The evaluation is described as demonstrating robustness across both dataset levels.
Loading 1901.04028v2…