qlib icon indicating copy to clipboard operation
qlib copied to clipboard

Anyone successfully run a US benchmark yet? There seem to be a bug with US version, instrument variable got evaluated to NAN.

Open tianlongwang opened this issue 2 years ago • 4 comments

🐛 Bug Description

To Reproduce

Steps to reproduce the behavior:

  1. take any yaml file under examples/benchmark. I'll take workflow_config_lightgbm_Alpha158.yaml for example.

  2. Change all fields from china version to US version: 2.1 change (provider_uri: "~/.qlib/qlib_data/cn_data") to (provider_uri: "~/.qlib/qlib_data/us_data") 2.2 change( region: cn) to (region: us) 2.3 change (market: &market csi300) to (market: &market sp500) 2.4 change (benchmark: &benchmark SH000300) to (benchmark: &benchmark ^GSPC)

  3. Run qrun workflow_config_lightgbm_Alpha158.yaml

Expected Behavior

AttributeError: 'float' object has no attribute 'lower'

Upon closer debugging, the instrument variable was evaluated to Nan.

Screenshot

image

Environment

Note: User could run cd scripts && python collect_info.py all under project directory to get system information and paste them here directly.

Windows AMD64 Windows-10-10.0.22621-SP0 10.0.22621

Python version: 3.8.15 (default, Nov 24 2022, 14:38:14) [MSC v.1916 64 bit (AMD64)]

Qlib version: 0.9.0.99 numpy==1.23.5 pandas==1.5.2 scipy==1.9.3 requests==2.28.1 sacred==0.8.2 python-socketio==5.7.2 redis==4.4.0 python-redis-lock==4.0.0 schedule==1.1.0 cvxpy==1.2.3 hyperopt==0.1.2 fire==0.5.0 statsmodels==0.13.5 xlrd==2.0.1 plotly==5.11.0 matplotlib==3.6.2 tables==3.8.0 pyyaml==6.0 mlflow==1.30.0 tqdm==4.64.1 loguru==0.6.0 lightgbm==3.3.3 tornado==6.2 joblib==1.2.0 fire==0.5.0 ruamel.yaml==0.17.21

Additional Notes

tianlongwang avatar Jan 28 '23 10:01 tianlongwang

It turns out that when reading in instrument/all.txt, stock symbol "NAN" will not be read in as string but instead as a float. What's the best way to solve this?

tianlongwang avatar Jan 28 '23 12:01 tianlongwang

Hello, can you share the downloaded dataset with me, I can't get on Yahoo, thank you very much.

chuhuan88 avatar Mar 14 '23 15:03 chuhuan88

Hi,how did you prepare your data,I run: python -m qlib.run.get_data qlib_data --target_dir ~/.qlib/qlib_data/us_data --region us and qrun benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml with your config mentioned before and find everything is OK. My environment is: image

Could you provide me with more information about this issue?

Fivele-Li avatar Mar 29 '23 08:03 Fivele-Li

tianlongwang Have you solved the problem? I have the same problem,

quant2008 avatar Jul 22 '23 11:07 quant2008