You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do I actually need to fit the model before implementing the historical forecast method? From what I understand, even if you do not fit the model, if retrain is set to False, the historical forecast method already fits the model once.
However, if I do not fit the model before historical forecast, I notice that setting retrain = False or setting retrain = True makes no difference in the speed of the method. If I do fit the model before, then it makes a difference.
Is that expected?
The text was updated successfully, but these errors were encountered:
This is a duplicate of #1617, it is the expected behavior introduced by #1465 to avoid mutating the underlying model object. You indeed should fit() the model before using historical_forecasts.
The model gets retrained because it was not fit before (Darts requires the models to be fit before prediction), regardless of the retrain argument value.
@madtoinou thanks for letting me know. just to be sure I got the methodology right, do I fit on the entire dataset that I have before doing historical forecast or do I only fit on the training set, i.e. between start_date and split_date, that is used by the historical forecast?
If you split your data into train and test split with my_series.split_before(split_point=split_date), then use split_date as your start in historical forecasts. This will perform historical forecasts only on your validation set (the train set is ignored).
# split series into train and test set
train_series, test_series = my_series.split_before(split_point=split_date)
# fit your model on train set
model.fit(train_series)
# perform historical forecasts on val set by setting `start=split_date` (use the original series)
model.historical_forecasts(series=my_series, ..., start=split_date, retrain=False)
Do I actually need to fit the model before implementing the historical forecast method? From what I understand, even if you do not fit the model, if retrain is set to False, the historical forecast method already fits the model once.
However, if I do not fit the model before historical forecast, I notice that setting retrain = False or setting retrain = True makes no difference in the speed of the method. If I do fit the model before, then it makes a difference.
Is that expected?
The text was updated successfully, but these errors were encountered: