Andreas Kaae
05/14/2024, 2:27 PM.update
functionality and the new_df
parameter of the .predict
- what is the difference between these to? I have a mlforecast model that I'm saving, I then later want to load it and make predictions using the newest data I have available.José Morales
05/14/2024, 3:53 PMAndreas Kaae
05/15/2024, 8:04 AM.update
is the right way for me.
If I have external features such as a price feature, this should then also be given to the .update
function?José Morales
05/15/2024, 4:10 PMX_df
Andreas Kaae
06/20/2024, 11:57 AMMLforecast().fit()
.
I have trained a model until 2024-06-20. Today I then want to use this and therefore need to give the latest data (so the correct lags are used). Should I then provide a dataframe with target, unique_id and ds column to the .update
function before I forecast as normally?
And if I have trained model on "A", "B" and "C" and only forecast for "A" - should I then update model with data for all three or just the one?José Morales
06/20/2024, 4:53 PMShould I then provide a dataframe with target, unique_id and ds column to theYes but only for the dates that the model hasn't seen, since we currently don't validate this (I'll open an issue for it). You can get the last dates the model saw withfunction before I forecast as normally?.update
MLForecast.ts.last_dates
, that has the last date by id, so when you call update it'll override the values there with the last date of the dataframe you provide to update
and append the series values to the stored ones.
And if I have trained model on "A", "B" and "C" and only forecast for "A" - should I then update model with data for all three or just the one?That depends on if you have target transformations or not. If you don't have target transformations then you can update just "A" and use
predict(..., ids=["A"])
to only forecast that one. If you have target transformations you'll need to update all series (but you can still use the ids
argument of predict to just predict for A).