|
10 | 10 | from cerebros.denseautomlstructuralcomponent.dense_automl_structural_component\ |
11 | 11 | import zero_7_exp_decay, zero_95_exp_decay, simple_sigmoid |
12 | 12 | from ast import literal_eval |
| 13 | +from os import listdir |
| 14 | +from os.path import exists |
| 15 | + |
13 | 16 |
|
14 | 17 | NUMBER_OF_TRAILS_PER_BATCH = 2 |
15 | 18 | NUMBER_OF_BATCHES_OF_TRIALS = 2 |
|
20 | 23 |
|
21 | 24 | ## your data: |
22 | 25 |
|
| 26 | +META_TRIAL_NUMBER = 1 |
23 | 27 |
|
24 | 28 | TIME = pendulum.now().__str__()[:16]\ |
25 | 29 | .replace('T', '_')\ |
26 | 30 | .replace(':', '_')\ |
27 | 31 | .replace('-', '_') |
28 | | -PROJECT_NAME = f'{TIME}_cerebros_auto_ml_test' |
29 | | - |
| 32 | +PROJECT_NAME = f"{TIME}_cerebros_auto_ml_test" |
| 33 | +PROJECT_NAME = f"{PROJECT_NAME}_meta_{META_TRIAL_NUMBER}" |
30 | 34 |
|
31 | | -# white = pd.read_csv('wine_data.csv') |
32 | 35 |
|
33 | 36 | raw_data = pd.read_csv('ames.csv') |
34 | 37 | needed_cols = [ |
|
110 | 113 | metrics=[tf.keras.metrics.RootMeanSquaredError()], |
111 | 114 | epochs=epochs, |
112 | 115 | patience=7, |
113 | | - project_name=f"{PROJECT_NAME}_meta_{meta_trial_number}", |
| 116 | + project_name=PROJECT_NAME, |
114 | 117 | # use_multiprocessing_for_multiple_neural_networks=False, # pull this param |
115 | 118 | model_graphs='model_graphs', |
116 | 119 | batch_size=batch_size, |
|
121 | 124 | best_model_found = cerebros.get_best_model() |
122 | 125 | print(best_model_found.summary()) |
123 | 126 |
|
| 127 | +# Validate that purge_model_storage is NOT active by default |
| 128 | +model_storage_path = f"{PROJECT_MAME}/models" |
| 129 | +assert exists(model_storage_path) |
| 130 | +num_items = len(listdir(model_storage_path)) |
| 131 | +print(f"There are {num_items} in {model_storage_path}") |
| 132 | +assert num_items > 0 |
| 133 | + |
124 | 134 | print("result extracted from cerebros") |
125 | 135 | print(f"Final result was (val_root_mean_squared_error): {result}") |
0 commit comments