Hi,
Shouldn’t the model be trained and tested on previous years data, and then only plotted to subsequent years of data? For example, data from year 2020-2024 inclusive to train & test the model, and then strategy model shall be implemented & plotted on year 2025 data?
Yes, that’s right. In our example, we trained the model on data from April 2013 to August 2017, and then tested the strategy from August 2017 to May 2019 and plotted the analytics for this test period.
I am assuming you have the price data till May 31 and want to predict the price during June. For that you would need to follow the same approach we’ve used in our strategy. First, make sure your model is trained on all available data up through May 2019. Then for each day in June, use the previous day’s data as inputs to predict the current day’s price movements (ex for June 1, use inputs from May 31; for June 2, use inputs from June 1). We have used the train data to calibrate the model parameters, which will now be applied to make these new predictions. Do this recursively, continuing the same prediction workflow we’ve established, just applied to the new time period you want to forecast.
Let me know if something is not clear. I didn’t consider test-train data split in the explanation above since you’re asking about production implementation. But if you want to consider model evaluation first, then it is fairly simple. Let’s say you have data for the whole year Jan to Dec. You want to implement 75-25 train-test split. Then I would train the model using the data till Sept end and then would test it on data from Oct through Dec to verify performance before using it for actual predictions.