# M5 Forecasting (Walmart) (2020)

> Five years of daily sales for 3,049 Walmart products in 10 stores. Most days, most items sell nothing.

Page: https://mralbu.github.io/ai-datasets/d/m5

## Key facts

- Category: Time series
- Task: Hierarchical forecasting of daily unit sales, 28 days ahead
- Creators: Spyros Makridakis, Evangelos Spiliotis, Vassilios Assimakopoulos, with Walmart, on Kaggle
- Size: 30,490 item-store series of 1,969 days (2011-01-29 to 2016-06-19)
- Splits: train 30,490
- Input: Daily unit sales history, plus a calendar (holidays, SNAP benefit days) and weekly prices
- Labels: Unit sales for each of the next 28 days, scored at 12 levels of aggregation
- License: Kaggle competition data
- Paper: [M5 accuracy competition: Results, findings, and conclusions](https://doi.org/10.1016/j.ijforecast.2021.11.013)
- Homepage: https://www.kaggle.com/competitions/m5-forecasting-accuracy
- Hugging Face: [autogluon/chronos_datasets](https://huggingface.co/datasets/autogluon/chronos_datasets)
- Sampled at Hub revision eeecad0b82a8c237e212ce6f8d1abecb513e2cec (2026-11-14)

## Why it matters

M5 brought the M competitions to Kaggle and to real retail data, with all its awkwardness: intermittent demand, a hierarchy from single item to all of Walmart, prices and holidays. More than 5,000 teams entered. The lesson was the reverse of M4's: gradient-boosted trees (LightGBM) trained on all series at once beat both statistical methods and deep networks, as long as the features were good.

## Worth knowing

- The stores are in three states: four in California, three in Texas and three in Wisconsin.
- The products fall into three categories (Foods, Hobbies, Household) and seven departments.
- Scoring covers 42,840 series: the 30,490 item-store series plus every aggregate, up to total sales.
- The sales are intermittent: many items have long runs of zero days, which breaks methods that assume smooth series.
- Christmas Day is the one day every store is closed, so all sales drop to zero.
- The samples show the last two years (730 days) of each series.

## Get the data

The Chronos copy: one row per item-store series, with its ids. The calendar and price files are on Kaggle.

```bash
# pip install -U huggingface_hub
hf download autogluon/chronos_datasets --repo-type dataset \
  --local-dir m5
```

```python
from datasets import load_dataset   # pip install datasets

ds = load_dataset("autogluon/chronos_datasets", "m5")
print(ds)
```

```python
import polars as pl

df = pl.read_parquet("hf://datasets/autogluon/chronos_datasets@~parquet/m5/train/*.parquet")
print(df.shape)
```

## Related datasets

- M4 Competition: 2018, 100,000 series (on this site: https://mralbu.github.io/ai-datasets/d/m4)
- [M5 Uncertainty](https://www.kaggle.com/competitions/m5-forecasting-uncertainty): the sister competition: forecast nine quantiles
- [Favorita Grocery Sales](https://www.kaggle.com/competitions/favorita-grocery-sales-forecasting): 2017, an earlier Kaggle retail-sales forecasting set
