Skip to main content

Forecasting Competitions Datasets (M1, M3, Tourism) for Python

Project description

fcompdata

Forecasting Competitions Datasets - a Python library for loading M and tourism competitions time series datasets (M1, M3, Tourism) with an interface similar to R's Mcomp and Tcomp packages.

Installation

pip install -e .

Usage

from fcompdata import M1, M3, Tourism

# Access series by 1-based index (R-style)
series = M3[1]
print(series['x'])    # Training data (numpy array)
print(series['xx'])   # Test data (numpy array)
print(series['h'])    # Forecast horizon
print(series['n'])    # Training data length
print(series['type']) # Series type (yearly, quarterly, monthly, other)

# Attribute access also works
print(series.sn)          # Series name
print(series.description) # Series description

# Filter by frequency type
yearly = M3.subset('yearly')
monthly = M1.subset('monthly')

# Iterate over all series
for series in M3:
    print(series.sn, len(series.x))

# Get series count
print(len(M3))  # 3003

Datasets

Dataset Series Yearly Quarterly Monthly Other
M1 1001 181 203 617 -
M3 3003 645 756 1428 174
Tourism 1311 518 427 366 -

Series Attributes

Each MCompSeries object has the following attributes:

Attribute Type Description
sn str Series name/identifier
x numpy.ndarray Training data (in-sample)
xx numpy.ndarray Test data (out-of-sample)
h int Forecast horizon
n int Length of training data
period int Seasonal period (1, 4, or 12)
type str Series type (yearly/quarterly/monthly/other)
description str Series description

Data Sources

The time series data in this package was imported from the following R packages:

  • Mcomp (M1 and M3 data): Hyndman, R.J. (2024). Mcomp: Data from the M-Competitions. R package. CRAN, GitHub
  • Tcomp (Tourism data): Hyndman, R.J. (2016). Tcomp: Data from the 2010 Tourism Forecasting Competition. R package. CRAN, GitHub

References

The datasets were used in the following forecasting competitions:

M1 Competition:

Makridakis, S., Andersen, A., Carbone, R., Fildes, R., Hibon, M., Lewandowski, R., Newton, J., Parzen, E., & Winkler, R. (1982). The accuracy of extrapolation (time series) methods: Results of a forecasting competition. Journal of Forecasting, 1(2), 111–153. doi:10.1002/for.3980010202

M3 Competition:

Makridakis, S., & Hibon, M. (2000). The M3-Competition: Results, conclusions and implications. International Journal of Forecasting, 16(4), 451–476. doi:10.1016/S0169-2070(00)00057-1

Tourism Forecasting Competition:

Athanasopoulos, G., Hyndman, R.J., Song, H., & Wu, D.C. (2011). The tourism forecasting competition. International Journal of Forecasting, 27(3), 822–844. doi:10.1016/j.ijforecast.2010.11.005

License

LGPL-3.0-or-later

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fcompdata-0.1.0.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fcompdata-0.1.0-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

Details for the file fcompdata-0.1.0.tar.gz.

File metadata

  • Download URL: fcompdata-0.1.0.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for fcompdata-0.1.0.tar.gz
Algorithm Hash digest
SHA256 59fa4c6d9ea8b4be885148c9dad27849d6a2c4126591df2a4bca1b932034c619
MD5 da5fc1f3272097ec155d0c5bda6d991c
BLAKE2b-256 b31939a744cd28e48357a5da3d6d9643b484b6f9fe233107e0ec15382089a809

See more details on using hashes here.

File details

Details for the file fcompdata-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fcompdata-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for fcompdata-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d2ede0196a4fb727b2cbfc888d25c011a8d6245e569f60a2638e21ec39189f12
MD5 c05054791e123882cd2d21c51a690d76
BLAKE2b-256 6e345e0486403dc843e7849eaa15085e6fa4aa6eac7e089725e47b2dbd0fb8ab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page