SJTU-Quant / MASTER

This is the official code and supplementary materials for our AAAI-2024 paper: MASTER: Market-Guided Stock Transformer for Stock Price Forecasting. MASTER is a stock transformer for stock price forecasting, which models the momentary and cross-time stock correlation and guide feature selection with market information.
96 stars 20 forks source link

Why each iteration can yield data for lookback_window days? #1

Closed jianzhang-happy closed 4 months ago

jianzhang-happy commented 4 months ago

Hello. Thank you for your outstanding work. While running your code, I have a small question: I'm curious about why the dataset obtained after running the iteration of DataLoader is four-dimensional (1NT*F). My main concern is how the time dimension T is introduced here. I noticed that the data type you provided is "qlib.data.dataset.TSDataSampler," and by referring to qlib's source code and the PyTorch official tutorial, I understand that this is a map-style dataset data type similar to PyTorch. When using DataLoader, it seems that the iterator of the Sampler you use returns data for only one day each time, rather than data for the lookback_window (8) days. Therefore, I am a bit confused about how each iteration can yield data for lookback_window days. I hope to receive your response, and once again, thank you!

jianzhang-happy commented 4 months ago

I think I have understood the reasons now. Thanks again for your outstanding work!