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
Hi, I had a general question comment - and also want to check my own understanding.
In NeuralForecast.fit, we can pass in a df, which can be a dataframe of various timeseries, including exog variables.
If there are any future exogenous variables, this is handled internally by self.futr_exog_list.
The dataframe gets converted to a TimeSeriesDataset in self._prepare_fit and pass this to model.predict.
Similarly, we can pass in a list of file paths, in which case the above process happens for each individual file through LocalFilesTimeSeriesDataset.
However, for NeuralForecast.predict, we must pass in separate dfs - one for historical variables (df) and one for future exogenous variables (futr_df).
Internally, in the predict function, we once again call prepare_fit, but this time just for the "historical" df, and get a TimeSeriesDataset.
We then append the futr_df to this TimeSeriesDataset, and pass this to model.predict.
The problem with having two different ways of doing this is that it makes it more difficult if we want to make any changes in the library for both. For example, we can't just use the same logic used in fit to allow a LocalFilesTimeSeriesDataset to be accepted for a list of filepaths in predict. Furthermore, in predict, each "unique id" must refer to one single "sample", as opposed to a timeseries where we can predict over sliding windows of that timeseries.
Another downside is that when creating data, we must reshape it for predict (split out into df and futr_df) rather than using the same data generation process for both training and evaluation or live data.
If we had both interfaces aligned, then ideally we could pass in the same data-related arguments for both so that ultimate the same "samples" would be passed to the underlying fit() and predict() methods.
Looking for thoughts/feedback on the above - cheers!
Use case
No response
The text was updated successfully, but these errors were encountered:
kevinleahy-switchdin
changed the title
[<Library component: Models|Core|etc...>]
[<Library component: Models|Core|etc...>] Inconsistency in fit/predict API?
Nov 20, 2024
Description
Hi, I had a general question comment - and also want to check my own understanding.
NeuralForecast.fit
, we can pass in adf
, which can be a dataframe of various timeseries, including exog variables.self.futr_exog_list
.TimeSeriesDataset
inself._prepare_fit
and pass this tomodel.predict
.LocalFilesTimeSeriesDataset
.NeuralForecast.predict
, we must pass in separate dfs - one for historical variables (df
) and one for future exogenous variables (futr_df
).predict
function, we once again callprepare_fit
, but this time just for the "historical" df, and get aTimeSeriesDataset
.futr_df
to thisTimeSeriesDataset
, and pass this tomodel.predict
.The problem with having two different ways of doing this is that it makes it more difficult if we want to make any changes in the library for both. For example, we can't just use the same logic used in
fit
to allow aLocalFilesTimeSeriesDataset
to be accepted for a list of filepaths inpredict
. Furthermore, inpredict
, each "unique id" must refer to one single "sample", as opposed to a timeseries where we can predict over sliding windows of that timeseries.Another downside is that when creating data, we must reshape it for predict (split out into
df
andfutr_df
) rather than using the same data generation process for both training and evaluation or live data.If we had both interfaces aligned, then ideally we could pass in the same data-related arguments for both so that ultimate the same "samples" would be passed to the underlying
fit()
andpredict()
methods.Looking for thoughts/feedback on the above - cheers!
Use case
No response
The text was updated successfully, but these errors were encountered: