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

double ensemble training bug after recent updates #928

Closed
2young-2simple-sometimes-naive opened this issue Feb 23, 2022 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@2young-2simple-sometimes-naive
Copy link
Contributor

🐛 Bug Description

[38178:MainThread](2022-02-23 02:40:54,390) ERROR - qlib.workflow - [utils.py:41] - An exception has been raised[KeyError: 0].
  File "./workflow.py", line 167, in <module>
    model.fit(dataset)
  File "/xxxxxxxxxx/.venv/lib/python3.8/site-packages/pyqlib-0.8.3.99-py3.8-linux-x86_64.egg/qlib/contrib/model/double_ensemble.py", line 95, in fit
    weights = self.sample_reweight(loss_curve, loss_values, k + 1)
  File "/xxxxxxxxxx/.venv/lib/python3.8/site-packages/pyqlib-0.8.3.99-py3.8-linux-x86_64.egg/qlib/contrib/model/double_ensemble.py", line 163, in sample_reweight
    weights[h["bins"] == b] = 1.0 / (self.decay**k_th * h_avg[i_b] + 0.1)
  File "/xxxxxxxxxx/.venv/lib/python3.8/site-packages/pandas/core/series.py", line 958, in __getitem__
    return self._get_value(key)
  File "/xxxxxxxxxx/.venv/lib/python3.8/site-packages/pandas/core/series.py", line 1069, in _get_value
    loc = self.index.get_loc(label)
  File "/xxxxxxxxxx/.venv/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 3619, in get_loc
    casted_key = self._maybe_cast_indexer(key)
  File "/xxxxxxxxxx/.venv/lib/python3.8/site-packages/pandas/core/indexes/category.py", line 471, in _maybe_cast_indexer
    return self._data._unbox_scalar(key)
  File "/xxxxxxxxxx/.venv/lib/python3.8/site-packages/pandas/core/arrays/categorical.py", line 1956, in _unbox_scalar
    code = self.categories.get_loc(key)
  File "/xxxxxxxxxx/.venv/lib/python3.8/site-packages/pandas/core/indexes/interval.py", line 637, in get_loc
    raise KeyError(key)

The setup for double ensemble is the default setup (workflow_config_doubleensemble_Alpha158.yaml)
This bug does not appear after switch model to lightgbm.

Environment

Linux
x86_64
Linux-4.18.0-147.el8.x86_64-x86_64-with-glibc2.2.5
#1 SMP Wed Dec 4 21:51:45 UTC 2019

Python version: 3.8.6 (default, Oct 22 2020, 17:03:03) [GCC 9.3.0]

Qlib version: 0.8.3.99
numpy==1.22.2
pandas==1.4.1
scipy==1.8.0
requests==2.27.1
sacred==0.8.2
python-socketio==5.5.2
redis==4.2.0rc1
python-redis-lock==3.7.0
schedule==1.1.0
cvxpy==1.1.18
hyperopt==0.1.2
fire==0.4.0
statsmodels==0.13.2
xlrd==2.0.1
plotly==5.6.0
matplotlib==3.5.1
tables==3.7.0
pyyaml==5.4.1
mlflow==1.23.1
tqdm==4.62.3
loguru==0.6.0
lightgbm==3.3.2
tornado==6.1
joblib==1.1.0
fire==0.4.0
ruamel.yaml==0.17.21

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