Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOC] Ensure clear documentation of base API - model.predict, decoder, test_dataset in TFT #1591

Open
ms042087 opened this issue Aug 12, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@ms042087
Copy link

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.

  1. 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.
  2. 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?
  3. 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?
  4. 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.

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

@moogoofoo
Copy link

moogoofoo commented Sep 14, 2024

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 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
@fkiraly fkiraly added the documentation Improvements or additions to documentation label Sep 14, 2024
@fkiraly
Copy link
Collaborator

fkiraly commented Sep 14, 2024

I see - I think we should turn this into a documentation issue first, to document the status quo in:

  • docstrings of methods
  • a complete usage tutorial

Once that's clear, based on that discussions on potential rearchitecture or interface changes can be had, if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants