-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecuteProgram.py
More file actions
114 lines (84 loc) · 3.56 KB
/
executeProgram.py
File metadata and controls
114 lines (84 loc) · 3.56 KB
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
105
106
107
108
109
110
111
112
113
114
from DataFormatters.incomeFormatter import execute_income_formatter
from DataFormatters.housingFormatter import execute_housing_formatter
from DataFormatters.irisFormatter import execute_iris_formatter
from DataFormatters.neighborhoodsFormatter import execute_neighborhood_formatter
from DataFormatters.reconciliation import execute_lookup_iris
# Explotation
from DataExploters.mapReduce import execute_map_reducers
from DataExploters.datasetGenerator import generate_ml_dataset
# Distributed ML
from DistributedML.ml_trainer import train_and_save
from DistributedML.ml_predict import deploy_and_predict
def menu_options():
print("\n\n\n ============= MENU OPTIONS =============\n")
print("0. Create LookUp Data (IRIS)")
print("1. Execute Data Formatters")
print("2. Prepare Data for KPIs")
print("3. Generate datasets for ML")
print("4. Train and save ML model")
print("5. Deploy ML model and predict")
print("6. Exit")
option = input("\nSelect a option (number): ")
if option.isdigit():
option = int(option)
return str(option)
def main():
print("Exectute P2...")
while True:
option = menu_options()
if option.isdigit():
# Execute the different zones of the DMBackbone pipeline
if int(option) == 0:
print("Create LookUp Data (IRIS)")
execute_lookup_iris()
print("LookUp Data Formatted")
elif int(option) == 1:
print("Execute Data Formatters")
print("Available formatters:")
print("0. Housing")
print("1. Income")
print("2. IRIS")
print("3. Neighborhood")
option = input("\nWhich data Formatter do you want to execute: ")
if option.isdigit():
option = int(option)
if option == 0:
print("Execute Data Formatter: Housing")
execute_housing_formatter()
print("Housing Data Formatted")
elif option == 1:
print("Execute Data Formatter: Income")
execute_income_formatter()
print("LookUp Data Formatted")
elif option == 2:
print("Execute Data Formatter: IRIS")
execute_iris_formatter()
print("Income Data Formatted")
elif option == 3:
print("Execute Data Formatter: Neighborhood")
execute_neighborhood_formatter()
print("Incidences Data Formatted")
else:
print("Invalid option")
continue
elif int(option) == 2:
print("Prepare Data for KPIs")
execute_map_reducers()
print("Data prepared")
elif int(option) == 3:
print("Generate datasets for ML")
generate_ml_dataset()
print("Datasets generated")
elif int(option) == 4:
print("Train and save ML model")
train_and_save()
print("Model trained and saved")
elif int(option) == 5:
print("Deploy ML model and predict")
deploy_and_predict()
print("Model deployed and predicted")
elif int(option) == 6:
print("Exit")
break
if __name__ == "__main__":
main()