Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run workflow_config_lightgbm_multi_freq.yaml: KeyError: 'PRED' #1740

Open
langslike opened this issue Jan 24, 2024 · 0 comments
Open

run workflow_config_lightgbm_multi_freq.yaml: KeyError: 'PRED' #1740

langslike opened this issue Jan 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@langslike
Copy link

Bug Description

when i run .\examples\benchmarks\LightGBM\workflow_config_lightgbm_multi_freq.yaml , i got error:

[9944:MainThread](2024-01-24 20:50:10,472) INFO - qlib.workflow - [recorder.py:374] - Fail to log the uncommitted code of $CWD(D:\Project\playground\quant\qlib\workflow_config_lightgbm_multi_freq) when run git diff --cached.
[9944:MainThread](2024-01-24 20:50:55,250) INFO - qlib.timer - [log.py:128] - Time cost: 41.668s | Loading data Done
[9944:MainThread](2024-01-24 20:50:55,253) INFO - qlib.timer - [log.py:128] - Time cost: 0.002s | DropnaLabel Done
D:\Anaconda\envs\py39\lib\site-packages\pyqlib-0.9.1.99-py3.9-win-amd64.egg\qlib\data\dataset\processor.py:324: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
df[cols] = df[cols].groupby("datetime", group_keys=False).apply(self.zscore_func)
[9944:MainThread](2024-01-24 20:50:55,265) INFO - qlib.timer - [log.py:128] - Time cost: 0.012s | CSZScoreNorm Done
[9944:MainThread](2024-01-24 20:50:55,266) INFO - qlib.timer - [log.py:128] - Time cost: 0.016s | fit & process data Done
[9944:MainThread](2024-01-24 20:50:55,267) INFO - qlib.timer - [log.py:128] - Time cost: 41.685s | Init data Done
Training until validation scores don't improve for 50 rounds
[20] train's l2: 0.996655 valid's l2: 0.996655
[40] train's l2: 0.996655 valid's l2: 0.996655
Early stopping, best iteration is:
[1] train's l2: 0.996655 valid's l2: 0.996655
[9944:MainThread](2024-01-24 20:50:55,519) INFO - qlib.timer - [log.py:128] - Time cost: 0.186s | waiting async_log Done
[9944:MainThread](2024-01-24 20:50:55,522) ERROR - qlib.workflow - [utils.py:41] - An exception has been raised[KeyError: 'PRED'].
File "D:\Anaconda\envs\py39\Scripts\qrun-script.py", line 33, in
sys.exit(load_entry_point('pyqlib==0.9.1.99', 'console_scripts', 'qrun')())
File "D:\Anaconda\envs\py39\lib\site-packages\pyqlib-0.9.1.99-py3.9-win-amd64.egg\qlib\workflow\cli.py", line 72, in run
fire.Fire(workflow)
File "d:\anaconda\envs\py39\lib\site-packages\fire\core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "d:\anaconda\envs\py39\lib\site-packages\fire\core.py", line 475, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "d:\anaconda\envs\py39\lib\site-packages\fire\core.py", line 691, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "D:\Anaconda\envs\py39\lib\site-packages\pyqlib-0.9.1.99-py3.9-win-amd64.egg\qlib\workflow\cli.py", line 66, in workflow
recorder = task_train(config.get("task"), experiment_name=experiment_name)
File "D:\Anaconda\envs\py39\lib\site-packages\pyqlib-0.9.1.99-py3.9-win-amd64.egg\qlib\model\trainer.py", line 127, in task_train
exe_task(task_config)
File "D:\Anaconda\envs\py39\lib\site-packages\pyqlib-0.9.1.99-py3.9-win-amd64.egg\qlib\model\trainer.py", line 56, in exe_task
task_config = fill_placeholder(task_config, placehorder_value)
File "D:\Anaconda\envs\py39\lib\site-packages\pyqlib-0.9.1.99-py3.9-win-amd64.egg\qlib\utils_init
.py", line 929, in fill_placeholder
now_item[key] = get_item_from_obj(config, m.groupdict()["name_path"])
File "D:\Anaconda\envs\py39\lib\site-packages\pyqlib-0.9.1.99-py3.9-win-amd64.egg\qlib\utils_init
.py", line 874, in get_item_from_obj
cur_cfg = cur_cfg[k]
KeyError: 'PRED'

To Reproduce

Steps to reproduce the behavior:
use command:
qrun workflow_config_lightgbm_multi_freq.yaml

I used daily data and 1min freq data downloaded with qlib GetData().

Environment

  • Qlib version: 0.9.1.99
  • Python version: py39
  • OS : windows 10
@langslike langslike added the bug Something isn't working label Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant