-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
107 lines (105 loc) · 3.54 KB
/
main.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
import argparse
from algorithms import *
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"-f",
"--filepath",
action="store",
default="email-Enron",
type=str,
help="Select the file path",
)
parser.add_argument(
"-d",
"--do",
action="store",
default="count_time_units",
type=str,
help="Select what to do",
)
parser.add_argument(
"-m",
"--m",
action="store",
default="43",
type=int,
help="Select the number of time units",
)
parser.add_argument(
"-k",
"--k-tuples",
action="store",
default="4",
type=int,
help="Select the size of hois",
)
parser.add_argument(
"-b",
"--basket-max",
action="store",
default="25",
type=int,
help="Select the maximum size of a hyperedge",
)
parser.add_argument(
"-i",
"--interval",
action="store",
default="10",
type=int,
help="Select the number of observed time units",
)
parser.add_argument(
"-t",
"--time-units",
action="store",
default="5",
type=int,
help="Select the of observed time units for measuring features",
)
parser.add_argument(
"-u",
"--unit",
action="store",
default="1",
type=int,
help="Select the unit",
)
parser.add_argument(
"-r",
"--read",
action="store",
default="local_group_group",
type=str,
help="Select what to read",
)
args = parser.parse_args()
if args.do == 'count_time_units':
count_time_units(args.filepath, args.unit)
elif args.do == 'graph':
graph(args.filepath)
elif args.do == 'graph_bi':
graph_bi(args.filepath)
elif args.do == 'global_analysis':
global_analysis(args.filepath, args.m, args.k_tuples, args.basket_max, args.interval)
elif args.do in ['local_analysis_past', 'local_analysis']:
local_analysis_save(args.filepath, args.m, args.k_tuples, args.basket_max, args.time_units, args.interval, args.do)
elif args.do in ['local_group_group_past', 'local_group_group']:
local_group_group(args.filepath, args.m, args.k_tuples, args.basket_max, args.time_units, args.interval, args.do)
elif args.do in ['local_node_group_past', 'local_node_group']:
local_node_group(args.filepath, args.m, args.k_tuples, args.basket_max, args.time_units, args.interval, args.do)
elif args.do in ['local_node_node_past', 'local_node_node']:
local_node_node(args.filepath, args.m, args.k_tuples, args.basket_max, args.time_units, args.interval, args.do)
elif args.do == 'global_stat':
global_stat(args.basket_max)
elif args.do == 'local_stat':
local_stat(args.basket_max, args.time_units, args.interval, args.do, args.read)
elif args.do in ['pred_1_past', 'pred_1']:
pred_1(args.filepath, args.m, args.k_tuples, args.basket_max, args.time_units, args.interval, args.do)
elif args.do in ['pred_2_past', 'pred_2']:
pred_2(args.filepath, args.m, args.k_tuples, args.basket_max, args.time_units, args.interval, args.do)
elif args.do in ['pred_feature_selection_past', 'pred_feature_selection']:
pred_feature_selection(args.k_tuples, args.basket_max, args.time_units, args.interval, args.do)
elif args.do == 'predictability':
predictability(args.basket_max, args.interval)