Skip to content

Instantly share code, notes, and snippets.

@pkgandhi
Created August 16, 2020 20:27
Show Gist options
  • Save pkgandhi/43fd29aaee0a7df18ef3a45fc4924995 to your computer and use it in GitHub Desktop.
Save pkgandhi/43fd29aaee0a7df18ef3a45fc4924995 to your computer and use it in GitHub Desktop.
Defining the parameters
def objective(trial):
# Categorical parameter
optimizer = trial.suggest_categorical('rf_criterion', ['gini', 'entropy'])
# Int parameter
num_layers = trial.suggest_int("rf_n_estimators", 10, 1000)
# Uniform parameter
dropout_rate = trial.suggest_uniform('rf_min_weight_fraction_leaf', 0.0, 1.0)
# Loguniform parameter
learning_rate = trial.suggest_loguniform('rf_parameter_x', 1e-5, 1e-2)
# Discrete-uniform parameter
drop_path_rate = trial.suggest_discrete_uniform('rf_parameter_y', 0.0, 1.0, 0.1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment