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

issues with nested data structure in space #3

Open
scigeek72 opened this issue Apr 18, 2019 · 0 comments
Open

issues with nested data structure in space #3

scigeek72 opened this issue Apr 18, 2019 · 0 comments

Comments

@scigeek72
Copy link

Hi,
I am following your implementation of hyper-parameter optimization of GBR (in my case). I am getting error when I define a space with nested data structure.

space = {
    'boosting_type': hp.choice('boosting_type', 
                                            [{'boosting_type': 'gbdt', 'subsample': hp.uniform('gbdt_subsample', 0.5, 1)}, 
                                             {'boosting_type': 'dart', 'subsample': hp.uniform('dart_subsample', 0.5, 1)},
                                             {'boosting_type': 'goss', 'subsample': 1.0}]),
    'num_leaves': hp.quniform('num_leaves', 30, 150, 1),
    'learning_rate': hp.loguniform('learning_rate', np.log(0.01), np.log(0.2)),
    'subsample_for_bin': hp.quniform('subsample_for_bin', 20000, 300000, 20000),
    'min_child_samples': hp.quniform('min_child_samples', 20, 500, 5),
    'reg_alpha': hp.uniform('reg_alpha', 0.0, 1.0),
    'reg_lambda': hp.uniform('reg_lambda', 0.0, 1.0),
    'colsample_bytree': hp.uniform('colsample_by_tree', 0.6, 1.0),
    'objective': ['regression']
}

When I run

best = fmin(fn=objective, space= space, algo=tpe_algorithm, max_evals=MAX_EVAL, trials=bayes_trials, rstate=np.random.RandomState(50))

I am getting the following error: (I am pasting only the final error comments rather than the entire Trace which is rather long).

----> 5 best = fmin(fn=objective, space= space, algo=tpe_algorithm, max_evals=MAX_EVAL, trials=bayes_trials, rstate=np.random.RandomState(50))
...
...
TypeError: Unknown type of parameter:boosting_type, got:dict

Any advice will be of value to me.

Thanks

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

1 participant