huawei-noah / HEBO

Bayesian optimisation & Reinforcement Learning library developped by Huawei Noah's Ark Lab

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'float' object cannot be interpreted as an integer

replacementAI opened this issue · comments

I get the following error TypeError: 'float' object cannot be interpreted as an integer when attempting to search with a XGB model.

space_cfg = [
{'name' : 'max_depth', 'type' : 'int', 'lb' : 1, 'ub' : 10},
{'name' : 'min_child_weight', 'type' : 'int', 'lb' : 1, 'ub' : 100},
{'name': 'n_estimators', 'type' : 'int', 'lb': 1, 'ub': 10000},
{'name': 'alpha', 'type': 'num', 'lb': 0, 'ub': 100},
{'name': 'lambda', 'type': 'num', 'lb': 0, 'ub': 100},
{'name': 'gamma', 'type': 'num', 'lb': 0, 'ub': 100},
{'name': 'eta', 'type': 'pow', 'lb': 1e-5, 'ub': 1},
{'name': 'colsample_bytree', 'type': 'num', 'lb': 1/3, 'ub': 1},
{'name': 'colsample_bylevel', 'type': 'num', 'lb': 1/3, 'ub': 1},
{'name': 'colsample_bynode', 'type': 'num', 'lb': 1/3, 'ub': 1},
{'name': 'subsample', 'type': 'num', 'lb': 1/27, 'ub': 100},
]

workaround: had to change type from num to int for alpha, lambda, and gamma

Looks like it's a bug that has been fixed in github repo but not uploaded on pypi, I'll built a new version of HEBO and upload to pypi later this week.

This is the bugfix commit

Sounds good, ill close the issue then.