yuqinie98 / PatchTST

An offical implementation of PatchTST: "A Time Series is Worth 64 Words: Long-term Forecasting with Transformers." (ICLR 2023) https://arxiv.org/abs/2211.14730
Apache License 2.0
1.37k stars 248 forks source link

Question about not applying inverse_transform #110

Closed DSonDH closed 2 months ago

DSonDH commented 2 months ago

Hi, I have a question about the PatchTST_supervised/exp/exp_main.py script.

As I'm new to time-series forecasting tasks, I don't know why not applying the inverse_transform() method to the model outputs. It might affect the scale of metrics. (But all the papers seem not to apply the inverse_transform() when calculating metrics.)

And one more question: When running the exp.predict() method, I think there should be a code using inverse_transform() to recover the original scale of the output sequences. Why the inverse_transform() is not applied?

Any comments will be appreciated!

binbinlan commented 2 months ago

cause don't inverse_transform make the metrics seems better (relatively small erro) ...hahaha... just added this function in the code like I do: if test_data.scale and self.args.inverse: shape = outputs.shape outputs = test_data.inverse_transform(outputs.squeeze(0)).reshape(shape)

DSonDH commented 2 months ago

Oh! thanks for the comment. Maybe that was one of the conventions. I'll just follow the convention :)