-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_tpot_on_openml_for_paper_binary.py
104 lines (86 loc) · 3.83 KB
/
run_tpot_on_openml_for_paper_binary.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import tpot2
import sklearn.metrics
import sklearn
import argparse
import tpot
import utils
import tpot2
import sklearn.datasets
def main():
# Read in arguements
parser = argparse.ArgumentParser()
#where to save the results/models
parser.add_argument("-s", "--savepath", default="binary_results", required=False, nargs='?')
#number of total runs for each experiment
parser.add_argument("-r", "--num_runs", default=1, required=False, nargs='?')
args = parser.parse_args()
n_jobs = 48
base_save_folder = args.savepath
num_runs = int(args.num_runs)
experiments = [
{
'automl': tpot2.TPOTEstimator,
'exp_name' : 'tpot2_untimed_30_gen_roc_auc',
'params': {
'scorers' : ['roc_auc'],
'scorers_weights': [1] ,
'population_size' : 48,
'generations' : 30,
'n_jobs':n_jobs,
'cv': sklearn.model_selection.StratifiedKFold(n_splits=10, shuffle=True, random_state=42),
'verbose':5,
'max_time_seconds': None,
'max_eval_time_seconds':60*5,
'crossover_probability':.10,
'mutate_probability':.90,
'mutate_then_crossover_probability':0,
'crossover_then_mutate_probability':0,
'other_objective_functions' : [tpot2.objectives.number_of_nodes_objective],
'other_objective_functions_weights':[-1],
'memory_limit':"20GB",
'preprocessing':False,
'classification':True,
},
},
{
'automl': tpot.TPOTClassifier,
'exp_name' : 'tpot_untimed_30_gen_roc_auc',
'params': {
'scoring': 'roc_auc',
'population_size' : 48,
'generations' : 29,
'n_jobs':n_jobs,
'cv': sklearn.model_selection.StratifiedKFold(n_splits=10, shuffle=True, random_state=42),
'verbosity': 2,
'max_time_mins': None,
'max_eval_time_mins' : 5,
},
},
]
task_id_lists = [
#189866,
189865,
167200,
126026,
189860,
75127,
189862,
75105,
168798,
126029,
168796,
167190,
167104,
167083,
167184,
126025,
75097,
167181,
168797,
189861,
167161,
167149,
]
utils.loop_through_tasks(experiments, task_id_lists, base_save_folder, num_runs)
if __name__ == '__main__':
main()