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 xgbranker_example error #4

Closed
lzhw520110 opened this issue Feb 7, 2018 · 3 comments
Closed

run xgbranker_example error #4

lzhw520110 opened this issue Feb 7, 2018 · 3 comments

Comments

@lzhw520110
Copy link

lzhw520110 commented Feb 7, 2018

win7 py2.7 xgboost 0.7
when run xgbranker_example, I get error as this
image
image
I add 'n_jobs' and 'random_state' to class XGBRanker.init(), This error dispeared, but I get a new error as this

Traceback (most recent call last):
File "", line 1, in
dtrain.handle))
File "C:\Users\Lenovo\Anaconda2\lib\site-packages\xgboost-0.7-py2.7.egg\xgboost\core.py", line 130, in _check_call
raise XGBoostError(_LIB.XGBGetLastError())
xgboost.core.XGBoostError: Invalid Parameter format for seed expect int but value='None'

When I set seed=0 in class XGBRanker.init() and run xgbranker_example again, get a new error as this:

[11:10:29] dmlc-core/include/dmlc/./logging.h:300: [11:10:29] src/tree/updater_colmaker.cc:657: Check failed: param.colsample_bylevel > 0U (0 vs. 0) colsample_bylevel cannot be zero.
Traceback (most recent call last):
File "", line 1, in
xgb_model=xgb_model, callbacks=callbacks)
File "C:\Users\Lenovo\Anaconda2\lib\site-packages\xgboost-0.7-py2.7.egg\xgboost\training.py", line 74, in _train_internal
bst.update(dtrain, i, obj)
File "C:\Users\Lenovo\Anaconda2\lib\site-packages\xgboost-0.7-py2.7.egg\xgboost\core.py", line 898, in update
dtrain.handle))
File "C:\Users\Lenovo\Anaconda2\lib\site-packages\xgboost-0.7-py2.7.egg\xgboost\core.py", line 130, in _check_call
raise XGBoostError(_LIB.XGBGetLastError())
xgboost.core.XGBoostError: [11:10:29] src/tree/updater_colmaker.cc:657: Check failed: param.colsample_bylevel > 0U (0 vs. 0) colsample_bylevel cannot be zero.

File "C:\Users\Lenovo\Anaconda2\lib\site-packages\xgboost-0.7-py2.7.egg\xgboost\training.py", line 204, in train
xgb_model=None)
File "C:\Users\Lenovo\Anaconda2\lib\site-packages\xgboost_ranking-0.6.1-py2.7.egg\xgboostextension\xgbranker.py", line 101, in fit
ranker.fit(X, y, [25, 25, 25, 25], eval_metric=['ndcg', 'map@5-'])
File "C:\Users\Lenovo\Anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile
execfile(filename, namespace)
File "C:\Users\Lenovo\Anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py", line 87, in execfile
exec(compile(scripttext, filename, 'exec'), glob, loc)
File "D:/0rqalpha/quantOS/xgbRanker/demo.py", line 22, in

I have no idea about this error!

@bigdong89
Copy link
Owner

I don't know what happened.
But it's obvious that recently xgboost-0.7 is released but I haven't upgrade my package.
Switch your xgboost to 0.6, it will be OK.
I will update it to 0.7 work with new version of xgboost when I'm free.
Good luck!

@FlorisHoogenboom
Copy link
Contributor

I've encounterd the same issue. I've made PR #5 for the upgrade to V0.7.

The reason for the error lies in the fact that the get_xgb_params function uses the init signature to get the parameters. Since this signature has changed in XGBoost v0.7 this error was raised.

@bigdong89
Copy link
Owner

Thanks, Floris! Codes are merged for 0.7!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants