# M4 Competition (2018)

> 100,000 real series, from yearly to hourly, to see which forecasting methods actually work.

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

## Key facts

- Category: Time series
- Task: Univariate point and interval forecasting, at six frequencies
- Creators: Spyros Makridakis, Evangelos Spiliotis, Vassilios Assimakopoulos (University of Nicosia, NTUA)
- Size: 100,000 series (48,000 monthly, 24,000 quarterly, 23,000 yearly, 4,227 daily, 414 hourly, 359 weekly)
- Splits: yearly 23,000, quarterly 24,000, monthly 48,000, weekly 359, daily 4,227, hourly 414
- Input: The history of one series, from 13 to over 9,000 observations
- Labels: The next 6 (yearly) to 48 (hourly) values, scored with sMAPE and MASE
- License: Free for research (M4 repository); the Hugging Face copy keeps each source's terms
- Paper: [The M4 Competition: Results, findings, conclusion and way forward](https://doi.org/10.1016/j.ijforecast.2018.06.001)
- Homepage: https://github.com/Mcompetitions/M4-methods
- Hugging Face: [autogluon/chronos_datasets](https://huggingface.co/datasets/autogluon/chronos_datasets)
- Sampled at Hub revision eeecad0b82a8c237e212ce6f8d1abecb513e2cec (2026-11-14)

## Why it matters

The M competitions have tested forecasting methods on real data since 1982, and M4 was the first at scale: 100,000 series from finance, industry, demography and economics. It settled an argument. Pure machine-learning methods did poorly, combinations of statistical methods did well, and the winner was a hybrid: Slawek Smyl's exponential smoothing fused with an LSTM. A year later N-BEATS beat it with deep learning alone, and M4 became the standard test for global forecasting models.

## Worth knowing

- The winning ES-RNN came from Uber; second place, FFORMA, learned from series features how to weight nine classic methods.
- Of the 17 most accurate methods, 12 were combinations of mostly statistical methods.
- Each series has a category (Micro, Macro, Industry, Finance, Demographic or Other); the series are anonymized, with no names or units.
- The samples show up to the last 600 points of each series.

## Configs

- `m4_yearly`: Yearly: forecast 6 years ahead
- `m4_quarterly`: Quarterly: forecast 8 quarters ahead
- `m4_monthly`: Monthly: forecast 18 months ahead
- `m4_weekly`: Weekly: forecast 13 weeks ahead
- `m4_daily`: Daily: forecast 14 days ahead
- `m4_hourly`: Hourly: forecast 48 hours ahead

## Get the data

The Chronos collection of forecasting datasets, one config per M4 frequency. The official CSVs, split into train and test, are in the M4 repository.

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

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

ds = load_dataset("autogluon/chronos_datasets", "m4_yearly")  # or any of: m4_quarterly, m4_monthly, m4_weekly, m4_daily, m4_hourly
print(ds)
```

```python
import polars as pl

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

## Related datasets

- [M3 Competition](https://forecasters.org/resources/time-series-data/m3-competition/): 2000, 3,003 series; the benchmark before M4
- M5 Competition: 2020, Walmart sales (on this site: https://mralbu.github.io/ai-datasets/d/m5)
- GIFT-Eval: 2024, the benchmark for foundation models; includes M4 (on this site: https://mralbu.github.io/ai-datasets/d/gift-eval)
- [Air Passengers](https://huggingface.co/datasets/duol/airpassengers): 1970, the classic single monthly series from Box and Jenkins (on this site: https://mralbu.github.io/ai-datasets/d/airline-passengers)

## Landmark papers

- [A hybrid method of exponential smoothing and recurrent neural networks for time series forecasting (ES-RNN)](https://doi.org/10.1016/j.ijforecast.2019.03.017) (2020)
- [N-BEATS: Neural basis expansion analysis for interpretable time series forecasting](https://arxiv.org/abs/1905.10437) (2019)

## Papers on this site that use it

- [N-BEATS (2019)](https://mralbu.github.io/ai-datasets/p/n-beats.md): A pure deep learning forecaster that beat the M4 competition winner without any statistical components.
- [Chronos (2024)](https://mralbu.github.io/ai-datasets/p/chronos.md): Turn numbers into tokens, train an unmodified language model on them, and forecast series it has never seen.
