16
$\begingroup$

I'm currently working on a demand forecasting task, with data on tens of thousands of products across a couple thousand stores. More specifically,I have a few years' worth of daily sales data per product in each store, and my goal is to forecast the future sales of each item in each store, one day ahead; then two days ahead, etc.

So far I've considered breaking down each product-store pair into a single time series, and doing a forecast for each time series as was done in Neal Wagner's paper, Intelligent techniques for forecasting multiple time series in real-world systems. In other words, I will use only the historical information of a particular store's sales of the product to forecast the future sales of that product in that store.

However, I've been browsing Kaggle and competitions like Corporación Favorita Grocery Sales Forecasting suggest a different approach, which is to use the information from all stores and all products to predict future sales. As I understand it, historical sales information of all products in all stores are dumped into the training set, from which the model will learn to forecasts future sales. It's very different from traditional time series methods, but apparently, based on the results of the competition, it works.

The latter method seems promising and more robust. However, there's the problem of having to process hundreds of millions of data points.

Which method is more appropriate for my task? For those who have worked on similar problems, which methodology would you recommend?

$\endgroup$
8
  • 2
    $\begingroup$ When I've worked on this, I've used the single time series approach, BUT with seasonality drawn from similar products (e.g. a category) in similar stores (e.g. a geographic segment where weather would be similar). But this is, in part, because of the time constraints: not all data arrived at the same time, and the time between last data arrival and when the forecast was needed was slight (sometimes negative!). These were operational considerations, not statistical ones. $\endgroup$
    – zbicyclist
    Commented May 6, 2018 at 13:19
  • $\begingroup$ @zbicyclist Thanks for sharing this! May I know how you were able to incorporate the seasonality of similar products in to the forecast? e.g., did you take the mean seasonality and add it as another feature in the model? $\endgroup$
    – meraxes
    Commented May 6, 2018 at 16:08
  • $\begingroup$ Deseasonalize, model, forecast, then reseasonalize. $\endgroup$
    – zbicyclist
    Commented May 7, 2018 at 19:51
  • $\begingroup$ @zbicyclist Hi how do you use a single time series approach and forecast into the future? Let's say the horizon is 18 months but the one product you want to forecast has only 3 months historical data. I understand we can train based on all available products, but each product doesn't always have the same length of historical data. $\endgroup$ Commented Jul 22, 2020 at 7:36
  • $\begingroup$ If you have 3 months of history and want to forecast 18 months, you have a couple of issues. (1) new products can have a different dynamic: early months are trial (people buying the first time, who may or may not like it). Later months are mostly repeat (people who are familiar with the product and buying again). $\endgroup$
    – zbicyclist
    Commented Jul 23, 2020 at 12:46

1 Answer 1

17
$\begingroup$

I wouldn't recommend the approach used by Neal et al.. Their data is unique for two reasons:

  • They are working with food data, which is usually denser and more stable than other retail product sales data. A given location will be selling dozens of milk cartons or egg packs per week and will have been selling those same products for decades, compared to fashion or car parts where it is not unusual to have sales of one single item every 3 or 4 weeks, and data available for only a year or two.

  • They are forecasting for warehouses not stores. A single warehouse covers multiple stores, so their data is even more dense than average. In fact a warehouse is typically used as a natural aggregation/grouping level for stores, so they are already essentially performing a grouping of store data.

Because of the nature of their data, they can get away with modeling individual time series directly. But most retailers' data would be too sparse at the individual sku/store level for them to pull that off.

As zbicyclist said, this problem is usually approached using hierarchical or multi-echelon forecasting. Commercial demand forecasting packages all use some form of hierarchical forecasting

The idea is to group products and stores into similar product and regions, for which aggregate forecasts are generated and used to determine overall seasonality and trend, which are then spread down reconciled using a Top-Down approach with the baseline forecasts generated for each individual sku/store combination.

Besides the challenge zbicyclist mentioned, a bigger problem is that finding the optimal groupings of products and stores is a non-trivial task, which requires a combination of domain expertise and empirical analysis. Products and stores are usually grouped together in elaborate hierarchies (By department, supplier, brand, etc..for products, by region, climate, warehouse, etc...for location) which are then fed to the forecasting algorithm along with historical sales data itself.


Addressing meraxes comments

How about the methods used in the Corporación Favorita Grocery Sales Forecasting Kaggle Competition, where they allow the models to learn from the sales histories of several (possibly unrelated) products, without doing any explicit grouping? Is this still a valid approach?

They're doing the grouping implicitly by using store, item, famlily, class, cluster as categorical features.

I've just read through a bit of Rob Hyndman's section on hierarchical forecasting. It seems to me that doing a Top-Down approach provides reliable forecasts for aggregate levels; however, it has the huge disadvantage of losing of information due to aggregation which may affect forecasts for the bottom-level nodes. It may also be "unable to capture and take advantage of individual series characteristics such as time dynamics, special events".

Three points regarding this:

  • The disadvantage he points to depends on the grouping of the data. If you you aggregate all the products and stores, then yes this would be a problem. For example aggregating all the stores from all regions would muddy out any region specific seasonalities. But you should be aggregating up only to the relevant grouping, and as I pointed out, this will require some analysis and experimentation to find.
  • In the specific case of retail demand, we are not worried about "loosing information due to aggregation" because frequently the times series at the bottom nodes (i.e. SKU/Store) contain very little information, which is why we aggregate them up to the higher levels in the first place.
  • For SKU/store specific events, the way we approach it on my team is to remove the event specific effects prior to generating a forecast, and then adding them back later, after the forecast is generated. See here for details.
$\endgroup$
8
  • $\begingroup$ Thanks for this insight! How about the methods used in the Corporación Favorita Grocery Sales Forecasting Kaggle Competition, where they allow the models to learn from the sales histories of several (possibly unrelated) products, without doing any explicit grouping? Is this still a valid approach? $\endgroup$
    – meraxes
    Commented May 7, 2018 at 2:15
  • $\begingroup$ I've just read through a bit of Rob Hyndman's section on hierarchical forecasting. It seems to me that doing a Top-Down approach provides reliable forecasts for aggregate levels; however, it has the huge disadvantage of losing of information due to aggregation which may affect forecasts for the bottom-level nodes. It may also be "unable to capture and take advantage of individual series characteristics such as time dynamics, special events". $\endgroup$
    – meraxes
    Commented May 7, 2018 at 11:31
  • $\begingroup$ Thanks for the elaborate explanation, @Alex! Regarding your last point, and this may be a little off-topic, but do you treat holidays the same way? i.e. remove their effects prior to generating forecasts, then add them back in later? $\endgroup$
    – meraxes
    Commented May 8, 2018 at 2:00
  • $\begingroup$ ^ I ask because I notice that my forecasts seem to be very sensitive to outliers in the data. My current approach is to winsorize the data, then use the series spike analyzer as described in the paper by Neal Wagner et al. to identify spikes explainable by holidays to add them back in afterwards. I understand that another way would be to use dummy variables to remove the effect of the holidays. Which approach would you recommend? $\endgroup$
    – meraxes
    Commented May 8, 2018 at 2:00
  • $\begingroup$ @meraxes we treat most holidays the same way as events - except for Christmas which shows as a seasonal pattern. Note that many holidays shift from year to year so you need to take that into account as well. $\endgroup$
    – Skander H.
    Commented May 8, 2018 at 4:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.