Skip to content

An end-to-end tutorial to forecast the M5 dataset using feature engineering pipelines and gradient boosting.

License

Notifications You must be signed in to change notification settings

caleb1985/m5-forecasting-tutorial

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Forecasting the M5 dataset using machine learning

An end-to-end tutorial on using a global forecasting model (i.e., LightGBM) on a retail sales dataset (the M5 competition) using multi-step recursive forecasting.

This tutorial emulates a batch forecasting workflow, breaking the process into multiple steps:

  1. Obtain the raw data.
  2. Create the base dataset containing sales, price, promos etc. by product id and date.
  3. Create a feature engineering pipeline, create the training data, and store the pipeline and training data.
  4. Train the model and store it.
  5. Create a forecast using recursive forecasting.
  6. Plot the forecast, feature importance, and other model diagnostics.

For more on feature engineering for time series forecasting check out this course.

Installation

This tutorial requires:

  • numpy
  • pandas
  • scikit-learn
  • joblib
  • matplotlib
  • sktime
  • jupyter
  • pyarrow
  • lightgbm

These can be installed by from the requirements.txt.

pip install -r requirements.txt

The notebooks were run on Python 3.10.2.

About

An end-to-end tutorial to forecast the M5 dataset using feature engineering pipelines and gradient boosting.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 100.0%