Skip to content

Instantly share code, notes, and snippets.

@gvyshnya
Created April 21, 2021 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gvyshnya/d84ccc0b3ccf4726d91e10d51775ce66 to your computer and use it in GitHub Desktop.
Save gvyshnya/d84ccc0b3ccf4726d91e10d51775ce66 to your computer and use it in GitHub Desktop.
Hyperopt search parameters dictionary
#integer and string parameters, used with hp.choice()
bootstrap_type = [{'bootstrap_type':'Poisson'},
{'bootstrap_type':'Bayesian',
'bagging_temperature' : hp.loguniform('bagging_temperature', np.log(1), np.log(50))},
{'bootstrap_type':'Bernoulli'}]
LEB = ['No', 'AnyImprovement'] #remove 'Armijo' if not using GPU
grow_policy = [
{'grow_policy':'SymmetricTree'},
# {'grow_policy':'Depthwise'},
{'grow_policy':'Lossguide',
'max_leaves': hp.quniform('max_leaves', 2, 32, 1)}]
ensemble_params = {
"lgb" : {
"num_leaves": scope.int(hp.quniform("num_leaves", 31, 200, 1)),
"max_depth": scope.int(hp.quniform("max_depth", 10, 24, 1)),
'learning_rate': hp.uniform('learning_rate', 0.01, 0.3),
'min_split_gain': hp.uniform('min_split_gain', 0, 1.0),
'min_child_samples': scope.int(hp.quniform("min_child_samples", 2, 700, 1)),
"subsample": hp.uniform("subsample", 0.2, 1.0),
"colsample_bytree": hp.uniform("colsample_bytree", 0.5, 1.0),
'reg_alpha': hp.uniform('reg_alpha', 1e-5, 1.0),
'reg_lambda': hp.uniform('reg_lambda', 0, 50),
'metric': 'auc',
'n_jobs': -1,
'n_estimators': 2000},
'xgb': {
'max_depth': scope.int(hp.quniform('xgb.max_depth', 10, 24, 1)),
'learning_rate': hp.uniform('xgb.learning_rate', 0.01, 0.3),
'gamma': hp.uniform('xgb.gamma', 1, 10),
'min_child_weight': scope.int(hp.quniform('xgb.min_child_weight', 2, 700, 1)),
'n_estimators': 2000,
'colsample_bytree': hp.uniform('xgb.colsample_bytree', 0.5, 0.9),
'subsample': hp.uniform('xgb.subsample', 0.5, 1.0),
'reg_lambda': hp.uniform('xgb.reg_lambda', 0, 100),
'reg_alpha': hp.uniform('xgb.reg_alpha', 1e-5, 0.5),
'objective': 'binary:logistic',
'tree_method': 'hist',
'eval_metric': 'auc',
'n_jobs': -1},
'cat': {
'depth': hp.quniform("cat.depth", 2, 16, 1),
'learning_rate': hp.uniform('cat.learning_rate', 0.01, 0.3),
'l2_leaf_reg': hp.uniform('cat.l2_leaf_reg', 3, 8),
'max_bin' : hp.quniform('cat.max_bin', 1, 254, 1),
'min_data_in_leaf' : hp.quniform('cat.min_data_in_leaf', 2, 700, 1),
'random_strength' : hp.loguniform('cat.random_strength', np.log(0.005), np.log(5)),
'leaf_estimation_backtracking' : hp.choice('cat.leaf_estimation_backtracking', LEB),
'fold_len_multiplier' : hp.loguniform('cat.fold_len_multiplier', np.log(1.01), np.log(2.5)),
'eval_metric': 'AUC',
'n_estimators': 2000
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment