Skip to main content

M5

M5.download

Downloads M5 Competition Dataset. Parameters:

M5.load

Downloads and loads M5 data. Parameters: Returns:

M5.source_url

Evaluation class

M5Evaluation

M5Evaluation.aggregate_levels

Aggregates the 30_480 series to get 42_840. Parameters: Returns:

M5Evaluation.evaluate

Evaluates y_hat according to M4 methodology. Parameters: Returns: Examples:

M5Evaluation.levels

M5Evaluation.load_benchmark

Downloads and loads a bechmark forecasts. Parameters: Returns: Example:

URL-based evaluation

The method evaluate from the class M5Evaluation can receive a url of a submission to the M5 competiton. The results compared to the on-the-fly evaluation were obtained from the official evaluation.

Pandas-based evaluation

Also the method evaluate can recevie a pandas DataFrame of forecasts.
By default you can load the winner benchmark using the following.

Validation evaluation

You can also evaluate the official validation set.

Kaggle-Competition-M5 References

The evaluation metric of the Favorita Kaggle competition was the normalized weighted root mean squared logarithmic error (NWRMSLE). Perishable items have a score weight of 1.25; otherwise, the weight is 1.0. NWRMSLE=i=1nwi(log(y^i+1)log(yi+1))2i=1nwi NWRMSLE = \sqrt{\frac{\sum^{n}_{i=1} w_{i}\left(log(\hat{y}_{i}+1) - log(y_{i}+1)\right)^{2}}{\sum^{n}_{i=1} w_{i}}}
  1. Corporación Favorita. Corporación favorita grocery sales forecasting. Kaggle Competition Leaderboard, 2018.
  2. Glib Kechyn, Lucius Yu, Yangguang Zang, and Svyatoslav Kechyn. Sales forecasting using wavenet within the framework of the Favorita Kaggle competition. Computing Research Repository, abs/1803.04037, 2018.