This repository has been archived by the owner on Apr 30, 2020. It is now read-only.
HitLuca
/
Incremental_predictive_monitoring_of_Business_Processes_with_a_priori_knowledge
Public archive
forked from kaurjvpld/Incremental-Predictive-Monitoring-of-Business-Processes-with-A-priori-knowledge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shared_variables.py
executable file
·165 lines (153 loc) · 4.74 KB
/
shared_variables.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
"""
This file was created in order to bring
common variables and functions into one file to make
code more clear
"""
import glob
import os
ascii_offset = 161
beam_size = 3
outputs_folder = '../output_files/'
data_folder = '../data/'
declare_models_folder = '../declare_models/'
epochs = 300
folds = 3
validation_split = 0.2
def get_unicode_from_int(ch):
return unichr(int(ch) + ascii_offset)
def get_int_from_unicode(unch):
return int(ord(unch)) - ascii_offset
def extract_last_model_checkpoint(log_name, models_folder, fold, model_type):
model_filepath = outputs_folder + models_folder + '/' + str(fold) + '/models/' + model_type + '/' + log_name + '/'
list_of_files = glob.glob(model_filepath + '*.h5')
latest_file = max(list_of_files, key=os.path.getctime)
return latest_file
def extract_declare_model_filename(log_name):
return declare_models_folder + log_name + '.xml'
log_settings = {
'10x5_1S': {
'formula': " []( ( \"6\" -> <>( \"3\" ) ) ) /\ <>\"6\" ",
'prefix_size_pred_from': 3,
'prefix_size_pred_to': 7
},
'10x5_1W': {
'formula': "<>(\"6\")",
'prefix_size_pred_from': 3,
'prefix_size_pred_to': 7
},
'10x5_3S': {
'formula': " []( ( \"6\" -> <>( \"1\" ) ) ) /\ <>\"6\" /\ []( ( \"8\" -> <>( \"1\" ) ) ) /\ <>\"8\" /\ ",
'prefix_size_pred_from': 3,
'prefix_size_pred_to': 7
},
'10x5_3W': {
'formula': "<>(\"8\") /\ <>(\"7\")",
'prefix_size_pred_from': 3,
'prefix_size_pred_to': 7
},
'5x5_1W': {
'formula': "<>(\"3\")",
'prefix_size_pred_from': 2,
'prefix_size_pred_to': 6
},
'5x5_1S': {
'formula': " []( ( \"3\" -> <>( \"4\" ) ) ) /\ <>\"3\" ",
'prefix_size_pred_from': 2,
'prefix_size_pred_to': 6
},
'5x5_3W': {
'formula': "<>(\"4\") /\ <>(\"3\")",
'prefix_size_pred_from': 2,
'prefix_size_pred_to': 4
},
'5x5_3S': {
'formula': " []( ( \"4\" -> <>( \"3\" ) ) ) /\ <>\"4\" /\ []( ( \"3\" -> <>( \"0\" ) ) ) /\ <>\"3\" /\ ",
'prefix_size_pred_from': 2,
'prefix_size_pred_to': 4
},
'10x20_1W': {
'formula': "<>(\"9\")",
'prefix_size_pred_from': 2,
'prefix_size_pred_to': 6
},
'10x20_1S': {
'formula': " []( ( \"8\" -> <>( \"9\" ) ) ) /\ <>\"8\" ",
'prefix_size_pred_from': 3,
'prefix_size_pred_to': 7
},
'10x20_3W': {
'formula': "<>(\"9\") /\ <>(\"6\") /\ <>(\"8\")",
'prefix_size_pred_from': 3,
'prefix_size_pred_to': 7
},
'10x20_3S': {
'formula': "[]( ( \"9\" -> <>( \"7\" ) ) ) /\ <>\"9\" /\ []( ( \"8\" -> <>( \"6\" ) ) ) /\ <>\"8\" /\ []( ( \"7\" -> <>( \"5\" ) ) ) /\ <>\"7\" ",
'prefix_size_pred_from': 3,
'prefix_size_pred_to': 7
},
'10x2_1W': {
'formula': "<>(\"2\")",
'prefix_size_pred_from': 3,
'prefix_size_pred_to': 7
},
'10x2_1S': {
'formula': " []( ( \"6\" -> <>( \"2\" ) ) ) /\ <>\"6\"",
'prefix_size_pred_from': 3,
'prefix_size_pred_to': 7
},
'10x2_3W': {
'formula': "<>(\"8\") /\ <>(\"7\")",
'prefix_size_pred_from': 5,
'prefix_size_pred_to': 7
},
'10x2_3S': {
'formula': " []( ( \"9\" -> <>( \"3\" ) ) ) /\ <>\"9\" /\ []( ( \"7\" -> <>( \"3\" ) ) ) /\ <>\"7\"",
'prefix_size_pred_from': 3,
'prefix_size_pred_to': 7
},
'50x5_1W': {
'formula': "<>(\"7\")",
'prefix_size_pred_from': 3,
'prefix_size_pred_to': 7
},
'50x5_1S': {
'formula': " []( ( \"7\" -> <>( \"8\" ) ) ) /\ <>\"7\"",
'prefix_size_pred_from': 3,
'prefix_size_pred_to': 7
},
'50x5_3W': {
'formula': "<>(\"9\") /\ <>(\"7\")",
'prefix_size_pred_from': 3,
'prefix_size_pred_to': 7
},
'50x5_3S': {
'formula': " []( ( \"9\" -> <>( \"7\" ) ) ) /\ <>\"9\" /\ []( ( \"8\" -> <>( \"7\" ) ) ) /\ <>\"8\"",
'prefix_size_pred_from': 6,
'prefix_size_pred_to': 7
},
'BPI2017_S': {
'formula': " []( ( \"17\" -> <>( \"18\" ) ) ) /\ <>\"17\"",
'prefix_size_pred_from': 6,
'prefix_size_pred_to': 9
},
'BPI2017_W': {
'formula': "<>(\"17\")",
'prefix_size_pred_from': 6,
'prefix_size_pred_to': 9
},
'BPI2012_S': {
'formula': " []( ( \"3\" -> <>( \"5\" ) ) ) /\ <>\"3\"",
'prefix_size_pred_from': 2,
'prefix_size_pred_to': 5
},
'BPI2012_W': {
'formula': "<>(\"6\")",
'prefix_size_pred_from': 4,
'prefix_size_pred_to': 8
},
'BPI2012_W_2': {
'formula': "<>(\"3\")",
'prefix_size_pred_from': 2,
'prefix_size_pred_to': 5
},
}