forked from hexie1995/Sequential-Link-Prediction
-
Notifications
You must be signed in to change notification settings - Fork 0
/
translate.py
51 lines (50 loc) · 1.29 KB
/
translate.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
def translate_community_label(name):
s = ""
if name[4]=="1":
s = s + "p = 0.95, "
elif name[4]=="2":
s = s + "p = 0.85, "
elif name[4]=="3":
s = s + "p = 0.75, "
if name[5]=="1":
s = s + "$\mu$ = 0.1, "
elif name[5]=="2":
s = s + "$\mu$ = 0.2, "
elif name[5]=="3":
s = s + "$\mu$ = 0.3, "
if name[6:]=="1":
s = s + "k = 1"
elif name[6:]=="2":
s = s + "k = 2"
elif name[6:]=="5":
s = s + "k = 5"
elif name[6:]=="0":
s = s + "k = 10"
elif name[6:]=="15":
s = s + "k = 15"
return s
def translate_edge_correlated(name):
s = ""
if name[4]=="1":
s = s + "p = 0.8, "
elif name[4]=="2":
s = s + "p = 0.7, "
elif name[4]=="3":
s = s + "p = 0.6, "
if name[5]=="1":
s = s + "$\mu$ = 0.1, "
elif name[5]=="2":
s = s + "$\mu$ = 0.2, "
elif name[5]=="3":
s = s + "$\mu$ = 0.3, "
if name[6:]=="1":
s = s + "k = 1"
elif name[6:]=="2":
s = s + "k = 2"
elif name[6:]=="5":
s = s + "k = 5"
elif name[6:]=="0":
s = s + "k = 10"
elif name[6:]=="15":
s = s + "k = 15"
return s