qlib
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.
🐛 Bug Description
To Reproduce
Steps to reproduce the behavior:
-
take any yaml file under examples/benchmark. I'll take workflow_config_lightgbm_Alpha158.yaml for example.
-
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)
-
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

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
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?
Hello, can you share the downloaded dataset with me, I can't get on Yahoo, thank you very much.
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:
Could you provide me with more information about this issue?
tianlongwang Have you solved the problem? I have the same problem,