Git Product home page Git Product logo

kaggle-m5-forecasting-1's Introduction

M5 Forecasting Competition - Accuracy and Uncertainty

Code for the accuracy and uncertainty streams of the M5 Forecasting competition.

This repository includes:

  • Code for training (using PyTorch) and generating submissions for both the streams (using k-fold or single split validation)
  • Code for WRMSSE and SPL loss functions as given in the competition guidelines
  • 2 main model architectures - Dilated Sequence2Sequence model and Sequence2Sequence with attention (applied from all encoder outputs to hidden state of each step in the decoder)
  • Options for sliding window training, rolling and lag features, and addition of random noise while training

Please refer to my Kaggle post for additional information.

Steps for training the model and generating submissions

Steps are identical for both the streams. They have been given below:

  1. Create a folder named data according to the structure below and place all the data files in it. Download links - accuracy and uncertainty.
    ├── accuracy_stream
    ├── uncertainty_stream
    ├── data
  2. Enter the corresponding directory for the stream you want to train.
  3. If required, modify the config.py file to change model architecture, loss function, number of epochs, training and validation periods, etc.
  4. From the data directory, run:
    python prepare_data.py
    This will prepare the data for training and evaluation by merging different data files and creating the required features.
  5. Start model training by running the below command from the root directory of the stream under consideration:
    python train.py
  6. To generate submission files, just run:
    python generate_submission.py
    Separate submission files will be generated for each fold. Ensembles have to be created manually.

Results

Accuracy Stream

Model Architecture Details Private Leaderboard Score Private Leaderboard Rank
seq2seq_w_attn_on_hid Sliding window training (window length = 28*13), 3-fold validation on last 3 28-day periods 0.68081 482 (top 9%)


Uncertainty Stream

Model Architecture Details Private Leaderboard Score Private Leaderboard Rank
seq2seq_w_attn_on_hid Sliding window training (window length = 28*13), 3-fold validation on last 3 28-day periods 0.18317 NA
dilated_seq2seq Sliding window training (window length = 28*13), 3-fold validation on last 3 28-day periods 0.18068 NA
Ensemble of seq2seq_w_attn_on_hid and dilated_seq2seq Sliding window training (window length = 28*13), 3-fold validation on last 3 28-day periods 0.17850 48 (top 6%)

Citations

kaggle-m5-forecasting-1's People

Contributors

arshjot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.