def test_default_dt_space(self):
     space = default_dt_space()
     space.random_sample()
     assert space.Module_DnnModule_1.param_values['dnn_layers'] == len(
         space.DT_Module.config.dnn_params['hidden_units'])
     assert space.Module_DnnModule_1.param_values['hidden_units'] == \
            space.DT_Module.config.dnn_params['hidden_units'][0][
                0]
     assert space.Module_DnnModule_1.param_values['dnn_dropout'] == \
            space.DT_Module.config.dnn_params['hidden_units'][0][
                1]
     assert space.Module_DnnModule_1.param_values['use_bn'] == space.DT_Module.config.dnn_params['hidden_units'][0][
         2]
Exemple #2
0
                             regularized=True,
                             candidates_size=30,
                             optimize_direction=OptimizeDirection.Maximize)

hdt = HyperDT(searcher,
              callbacks=[
                  SummaryCallback(),
                  FileStorageLoggingCallback(searcher,
                                             output_dir=f'hotexamples_com/hyn_logs')
              ],
              reward_metric='AUC',
              earlystopping_patience=1)

space = mini_dt_space()
assert space.combinations == 589824
space2 = default_dt_space()
assert space2.combinations == 3559292928

df = dsutils.load_adult()
# df.drop(['id'], axis=1, inplace=True)
df_train, df_test = train_test_split(df, test_size=0.2, random_state=42)
X = df_train
y = df_train.pop(14)
y_test = df_test.pop(14)
# dataset_id='adult_whole_data',
hdt.search(
    df_train,
    y,
    df_test,
    y_test,
    max_trials=3,