My understanding was that a pre-trained model can ...
# neural-forecast
f
My understanding was that a pre-trained model can be used in inference to predict any interval in the future so long as the historic and future exogenous features are provided accordingly. So let's say a model is trained with data from time t0 to time t1 on a horizon of h1 being 365 days. Now we are at time t2 (t2 > t1) and we want to run an inference to predict with a horizon of h2 being 395 days (h2 > h1). As long as we update the training data to go from t0 to t2 and the future data to go from t2 to t2+h2 we should be able to predict h2 steps into the future. No? I load my pre-trained model which was trained with h1=365. I have updated df_train to go from t0 to t2 and futr_dt to go from t2 to t2+395. But I only get predictions for 365 days which was the horizon of the pre-trained model and not for 395 days. I am running:
df_pred = nf.predict(df=df_train, futr_df=futr_df)
Where nf is my pre-trained model. Am I missing something? Does the predict only work for the horizon we originally trained our model on? Besides updating the date ranges and values in df_train and futr_df, is there any other input we should pass so the predict method knows we want predictions for a longer horizon than the one previously saved in the pre-trained model?
m
Hello! In general, I don't think it's a good idea to forecast on a longer horizon than what the model was trained for. The model can have an unepected behaviour and you have not tested it for that horizon, so it's hard to be confident in its predictions. Like you say, you can predict for an horizon smaller or equal to what the model was trained for. Otherwise, as a workaround, you could forecast in two steps, but you would have to use your predictions as inputs, which can magnifiy errors. I hope this helps!
🙏 1
f
@Marco appreciate your response! Yes, I was thinking of doing it in two steps but it involves more work than changing the initial pre-training horizon to 395. I haven't decided which one is a better option yet. The reason I did not pre-train on 395 days is that there will be smaller amount of data left for validation during the training if I increase the horizon since my val_size=1*h for fitting. I also know that the periodicity is 365 so it makes more sense to train the model on 365. I think for now doing the two steps might be a slightly better option. Thanks again!