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
From my understanding, encoder should have the length equal max_encoder_length. Decoder, which represents the future values, should have the length equal max_prediction_length.
In the decoder, I should only fill up the known future values. For the unknown future values, should I set it with 0 by pd.concat([encoder, decoder]).fillna(0.0) or NaN? I have tried to fill in NaN but the model.predict function does not accept NaN values. If I fill the unknown value of 0, will it affect the prediction or they will be ignored during inference?
If one of the target_col is in the time_varying_unknown_reals in the model training (i.e. for learning how the past values affect the future values), what should I set in the decoder? If I set them to 0, will the model predict the target_col value correctly?
If I understand correctly from [1], I should create a testing data set from from_dataset method first with predict = True. It will makes the last items in pd.concat([encoder, decoder]) with max_prediction_length, i.e., the decoder to be the predicted target.
I agree that the documentation is not at all clear that the target values are passed to the encoder. This should be made abundantly clear. This may be related to issue #1585
fkiraly
changed the title
Understanding model.predict, decoder, test_dataset in TFT
[DOC] Ensure clear documentation of base API - model.predict, decoder, test_dataset in TFT
Sep 14, 2024
I have trouble in understanding in how to predict the future value with some known future feature.
For example in the predict on new data section in the official tutorial: https://pytorch-forecasting.readthedocs.io/en/latest/tutorials/stallion.html#Predict-on-new-data.
pd.concat([encoder, decoder]).fillna(0.0)
or NaN? I have tried to fill in NaN but the model.predict function does not accept NaN values. If I fill the unknown value of 0, will it affect the prediction or they will be ignored during inference?from_dataset
method first withpredict = True
. It will makes the last items inpd.concat([encoder, decoder])
with max_prediction_length, i.e., the decoder to be the predicted target.Thanks a lot for your help in advance.
[1] https://pytorch-forecasting.readthedocs.io/en/stable/api/pytorch_forecasting.data.timeseries.TimeSeriesDataSet.html#pytorch_forecasting.data.timeseries.TimeSeriesDataSet.from_dataset
The text was updated successfully, but these errors were encountered: