Skip to content

Instantly share code, notes, and snippets.

@joshreini1
Created August 30, 2022 19:49
Show Gist options
  • Save joshreini1/c784ce1114c789fb725e4c0dbf944a42 to your computer and use it in GitHub Desktop.
Save joshreini1/c784ce1114c789fb725e4c0dbf944a42 to your computer and use it in GitHub Desktop.
Set hyperparameter space
from hyperopt import STATUS_OK, Trials, fmin, hp, tpe
#use post data instead of pipe for hyperparameter tuning, get x_test_post
X_test_post = comprehensive_preprocessing.fit_transform(X_test, y_test)
#set hyperparameter space
space={'max_depth': hp.quniform("max_depth", 3, 18, 1),
'gamma': hp.uniform ('gamma', 0, 18),
'reg_alpha' : hp.uniform('reg_alpha', 0,1),
'reg_lambda' : hp.uniform('reg_lambda', 0,2),
'min_child_weight' : hp.uniform('min_child_weight', 0, 20),
'n_estimators': 1000,
'seed': 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment