-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparser_helper.py
89 lines (76 loc) · 3.13 KB
/
parser_helper.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
from const import ALL_DETECTION_METHODS
def add_real_graph_args(parser):
parser.add_argument('-g', '--graph_path',
required=True,
type=str,
help='path of graph')
def add_community_graph_args(parser):
parser.add_argument('-i', '--graph_id',
required=True,
type=int,
help='id of the graph')
parser.add_argument('-k', '--num_communities',
required=True,
type=int,
help='number of communities')
parser.add_argument('-s', '--community_size',
required=True,
type=int,
help='num. nodes in each community')
parser.add_argument('-d', '--internal_density',
type=float,
required=True,
help='')
parser.add_argument('-n', '--internal_negative_ratio',
type=float,
required=True,
help='')
parser.add_argument('-p', '--external_edge_proba',
type=float,
required=True,
help='')
parser.add_argument('-e', '--external_neg_ratio',
type=float,
required=True,
help='')
parser.add_argument('-g', '--graph_dir',
type=str,
default='./graphs',
help='directory of graph data')
def add_pagerank_args(parser):
parser.add_argument('-q', '--query_node',
type=int,
help='the query node')
parser.add_argument('--teleport_alpha',
type=float,
default=0.5,
help='probability to teleport')
parser.add_argument('--max_iter',
type=int,
default=10,
help='maximum number of iterations')
def add_detection_methods_args(parser):
parser.add_argument('-m', '--method',
choices=ALL_DETECTION_METHODS,
required=True,
help='')
def add_motif_args(parser):
parser.add_argument('-m', '--motifs',
required=True,
nargs='+',
type=str,
help='the list of motifs separated by space')
def add_misc_args(parser):
parser.add_argument('--verbose',
type=int,
default=0,
help='verbose level')
parser.add_argument('--show_progress',
action='store_true',
help='show progress bar or not')
parser.add_argument('--save_db',
action='store_true',
help='store to db or not')
parser.add_argument('-experiment_id',
type=str,
help='the unique experiment id')