/m5-accuracy

Silver medal solution for the "M5 Forecasting - Accuracy" Kaggle competition

Primary LanguagePythonMIT LicenseMIT

Silver Medal Solution of M5 Forecasting - Accuracy Kaggle Competition

About The Project


Given hierarchical sales data from Walmart, the world’s largest company by revenue, we need to forecast daily sales for the next 28 days.

Competition image

This is my solution to the M5 Forecasting - Accuracy Kaggle competition. I used a LightGBM to train on the tabular dataset, which was preprocessed to include 7-day and 28-day rolling mean features.

Result: Weighted root mean squared scaled error (RMSSE) score of 0.63730 in the private leaderboard. Ranked 248 out of 5558 teams (Top 5% - silver medal).

Getting Started

To get a local copy up and running, follow these simple example steps.

Installation

  1. Clone the repo

    git clone https://github.com/stephenllh/m5_accuracy.git
  2. Change directory

    cd m5_accuracy
  3. Install packages

    pip install requirements.txt

Usage

  1. Change directory

    cd m5_accuracy
  2. Create a directory called input

    mkdir input
    cd input
  3. Download the dataset into the folder

    • Option 1: Use Kaggle API
      • pip install kaggle
      • kaggle competitions download -c m5-forecasting-accuracy
    • Option 2: Download the dataset from the competition website.
  4. Run the training script

    cd ..
    python train.py
  5. (Optional) Run the inference script

    python inference.py

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Stephen Lau - Email - Twitter - Kaggle