Skip to content

PatchTST: Add support for time features - #3167

Merged
rshyamsundar merged 7 commits into
awslabs:devfrom
rshyamsundar:patchTSTx
May 28, 2024
Merged

PatchTST: Add support for time features#3167
rshyamsundar merged 7 commits into
awslabs:devfrom
rshyamsundar:patchTSTx

Conversation

@rshyamsundar

Copy link
Copy Markdown
Contributor

Description of changes:
Adding support for including time features in the PachTST model. The original PatchTST paper does not talk about time-based features and there are several ways one could include them.

Here we go with this simple approach (and maintain the simplicity of the PatchTST model):

  • Similar to target time series, time series features, if provided, are converted to patches and appended to the target patches.
  • Since PatchTST is encoder only model, we combine past_time_feat and future_time_feat (this dichotomy is an artefact of gluonts) and (left) shift them by prediction_length so that the features are aligned with the target input.

Added tests for the PatchTSTEstimator with features enabled.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Please tag this pr with at least one of these labels to make our release process faster: BREAKING, new feature, bug fix, other change, dev setup

@rshyamsundar
rshyamsundar requested a review from lostella May 6, 2024 06:11
@kashif

kashif commented May 6, 2024

Copy link
Copy Markdown
Contributor

@rshyamsundar the "lag-tst" model can also be tried as it allows one to take those features naturally

@melopeo melopeo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants