sktime / pytorch-forecasting

Time series forecasting with PyTorch
https://pytorch-forecasting.readthedocs.io/
MIT License
3.98k stars 631 forks source link

Trained Models attention only on recent data #165

Closed Clickative closed 3 years ago

Clickative commented 3 years ago

I made a model to predict some stock market features but the results seem to be very weird. I used the "Demand forecasting with the Temporal Fusion Transformer" example as a base but my model seems to be off, despite having a larger size, more training, more data etc.

learning_rate=0.013489628825916528, #I got the learning rate by tuner.
hidden_size=64,
attention_head_size=16,
dropout=0.1,
hidden_continuous_size=16,
output_size=7,
loss=QuantileLoss(),
log_interval=10,
reduce_on_plateau_patience=4,

Here are some prediction examples: download (9) download (8) download (7)

Since I'm using colab for training, I did run around 100 epochs, but there were no good. My dataset has 488468 rows, and 6 time_varying_unknown_reals. I really don't understand why at this point the network is misbehaving.

Quick Note: I also calculated the "Actuals vs predictions by variables" and the results in that part seem to be a little more promising but ended up confusing me even more. download (12) download (11) download (10)

jdb78 commented 3 years ago

Could you provide the dataset definition? Stock market prices are notoriously difficult to predict. If you want to generate alpha, I believe you need more than just the stock prices.