Skip to content

Instantly share code, notes, and snippets.

@WillKoehrsen
Created July 2, 2018 14:36
Show Gist options
  • Save WillKoehrsen/080cca2a08615fac9da593101c449072 to your computer and use it in GitHub Desktop.
Save WillKoehrsen/080cca2a08615fac9da593101c449072 to your computer and use it in GitHub Desktop.
# Define the search space
space = {
'class_weight': hp.choice('class_weight', [None, 'balanced']),
'boosting_type': hp.choice('boosting_type', [{'boosting_type': 'gbdt', 'subsample': hp.uniform('gdbt_subsample', 0.5, 1)},
{'boosting_type': 'dart', 'subsample': hp.uniform('dart_subsample', 0.5, 1)},
{'boosting_type': 'goss'}]),
'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)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment