Assembling public and private predictions
You can see an example about how we assembled the predictions for both the public and private leaderboards here:
- Public leaderboard example: https://www.kaggle.com/lucamassaron/m5-predict-public-leaderboard
- Private leaderboard example: https://www.kaggle.com/code/lucamassaron/m5-predict-private-leaderboard
What changes between the public and private submissions is just the different last training day: it determinates what days we are going to predict.
In this conclusive code snippet, after loading the necessary packages, such as LightGBM, for every end of training day, and for every prediction horizon, we recover the correct notebook with its data. Then, we iterate through all the stores and predict the sales for all the items in the time ranging from the previous prediction horizon up to the present one. In this way, every model will predict on a single week, the one it has been trained on.
import numpy as np
import pandas as pd
import os...