timeseriesAI / tsai

Time series Timeseries Deep Learning Machine Learning Python Pytorch fastai | State-of-the-art Deep Learning library for Time Series and Sequences in Pytorch / fastai
https://timeseriesai.github.io/tsai/
Apache License 2.0
4.92k stars 622 forks source link

Q: tsai requires that both inputs and outputs have the *same* shape [# samples, # features, # steps]? #830

Open mw66 opened 10 months ago

mw66 commented 10 months ago

https://github.com/timeseriesAI/tsai/blob/main/tutorial_nbs/15_PatchTST_a_new_transformer_for_LTSF.ipynb

... remember that tsai requires that both inputs and outputs have the following shape:

[# samples, # features, # steps]

I'm wondering can the output shape be:

[# samples, # 1, # 1]

i.e. for one sample: -- input: multiple feature, multiple steps -- output: single feature

?

If yes, is there an example for this usage?

MOREDataset commented 10 months ago

Yes! I have used tsai before for regression problems. Not sure if you will get good results but it is possible!

On Mon, Sep 4, 2023, 2:41 PM mw66 @.***> wrote:

https://github.com/timeseriesAI/tsai/blob/main/tutorial_nbs/15_PatchTST_a_new_transformer_for_LTSF.ipynb

... remember that tsai requires that both inputs and outputs have the following shape:

[# samples, # features, # steps]

I'm wondering can the output shape be:

[# samples, # 1, # 1]

i.e. for one sample: -- input: multiple feature, multiple steps -- output: single feature

?

— Reply to this email directly, view it on GitHub https://github.com/timeseriesAI/tsai/issues/830, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADK3KUGRLYMFGOMPB7KX4QDXYYVHVANCNFSM6AAAAAA4KZSMYA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

WenBin6 commented 6 months ago

https://github.com/timeseriesAI/tsai/blob/main/tutorial_nbs/15_PatchTST_a_new_transformer_for_LTSF.ipynb I attempted to use x with 15 features to predict y with 8 features. However, no matter how I followed the code instructions, the model's output dimension for the number of features was consistently incorrect. Could you please help me with this?

MOREDataset commented 6 months ago

Hi! The output should not be the same size of the input as it would only be reflecting one feature rather than multiple as in the input. For regression for instance, the output would have the same length of the input (same number of rows) but only one column reflecting the output feature to predict. For multihorizon forecasting problems it would have multiple columns one per horizon but still the same length as the input. I would recommend you to try out the tutorials available in the library and then using your own data. I hope this helps.

On Mon, Dec 25, 2023, 7:30 AM 刘文彬 @.***> wrote:

https://github.com/timeseriesAI/tsai/blob/main/tutorial_nbs/15_PatchTST_a_new_transformer_for_LTSF.ipynb I attempted to use x with 15 features to predict y with 8 features. However, no matter how I followed the code instructions, the model's output dimension for the number of features was consistently incorrect. Could you please help me with this?

— Reply to this email directly, view it on GitHub https://github.com/timeseriesAI/tsai/issues/830#issuecomment-1868986493, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADK3KUGH6QRH5GMJFLRGNUTYLF5WXAVCNFSM6AAAAAA4KZSMYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRYHE4DMNBZGM . You are receiving this because you commented.Message ID: @.***>