SJTU-DMTai / 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.
171 stars 36 forks source link

How to view the DataFrame format of datasets generated using qlib? #9

Closed ElonJustin7 closed 6 months ago

ElonJustin7 commented 7 months ago

Thank you for your excellent work! I would like to ask how to view the DataFrame format of dl_train generated by qlib, since it is a TSDataSampler, or how to generate and save dl_train directly without using the YAML format, similar to the dataset you provided in your code?

截屏2024-05-07 16 01 35

My main purpose is to check whether the generated dataset is correct because YAML seems to be unable to view the generated DataFrame. Thank you!

ElonJustin7 commented 7 months ago

By the way, where can I find the saved prediction scores and related metrics generated from workflow_config_master_Alpha158.yaml?

ElonJustin7 commented 7 months ago

"The pkl file you provided can be viewed using .data to see the DataFrame, but the dl_train generated above using qlib cannot be viewed using .data and reports an error: 'TSDataSampler' object has no attribute 'data'."

截屏2024-05-07 16 35 55
zhiyuan5986 commented 6 months ago

You can check the original code of TSDataSampler in qlib.data.dataset.__init__. In the last line of TSDataSampler.__init__(), the official code del self.data to save memory. If you want to check the dataframe, you can uncomment del self.data and print dl_train.data.

ElonJustin7 commented 6 months ago

Thank you for your response! I will give it a try