Repository navigation
Change parameters type for custom tuning #500
Unanswered
Ana Rita Pena (ppyarpe)
asked this question in
Q&A
Replies: 1 comment 6 replies
|
The |
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I am currently using FLAML with custom tunning for a DPBoost (https://github.com/QinbinLi/DPBoost) implementation.
DPBoost overrides lightgbm and hence to use it ones uses the same functions as LightGBM.
When I run lgb.train(params,data) I get the following error:
File "", line 1, in
model=lgb.train(params,data)
File "C:\Users\Rita\AppData\Roaming\Python\Python37\site-packages\lightgbm\engine.py", line 156, in train
if num_boost_round <= 0:
TypeError: '<=' not supported between instances of 'Integer' and 'int'
Params:
{'num_leaves': <flaml.tune.sample.Integer at 0x185a255ef28>,
'max_depth': <flaml.tune.sample.Integer at 0x185a255eda0>,
'learning_rate': <flaml.tune.sample.Float at 0x185a255e630>,
'num_iterations': <flaml.tune.sample.Integer at 0x185a255e780>,
'my_n_trees': <flaml.tune.sample.Integer at 0x185a255edd8>,
'lambda_l2': <flaml.tune.sample.Float at 0x185a253a048>,
'bagging_freq': <flaml.tune.sample.Integer at 0x185a3c11c50>,
'bagging_fraction': <flaml.tune.sample.Float at 0x185a253a160>,
'max_bin': <flaml.tune.sample.Integer at 0x185a253a0b8>,
'inner_boost_round': <flaml.tune.sample.Integer at 0x185a253a1d0>,
'total_budget': 1,
'verbose': -2,
'boosting_type': 'gbdt',
'objective': 'regression',
'metric': 'binary_error',
'boost_method': 'DPBoost_2level',
'high_level_boost_round': 1,
'balance_partition': 0,
'geo_clip': 1,
'boost_from_average': False}
where the flaml.tune objects come from the configurations and search space.
And data is a lightgbm Dataset.
Is there any way to change the flaml.tune objects into different types in order to feed into the lgb.train function from DPBoost ?
When I try int(params['num_leaves']) ,for example, I get the following error:
Traceback (most recent call last):
File "", line 1, in
int(params['num_leaves'])
TypeError: int() argument must be a string, a bytes-like object or a number, not 'Integer'
All reactions