@@ -10,14 +10,22 @@ def within_community_degree(weighted_partition, nan = 0.0, catch_edgeless_node=T
10
10
------
11
11
Parameters
12
12
------
13
- weighted_partition = Louvain Weighted Partition
14
- nan = number to replace unexpected values (e.g., -infinity) with
15
- catch_edgeless_node = raise ValueError if node degree is zero
13
+ weighted_partition: Louvain Weighted Partition
14
+ louvain = weighted_modularity.wm.LouvainCommunityDetection()
15
+ weighted_partitions = louvain.run()
16
+ weighted_partition = weighted_partition[0], where index is the partition level
17
+ nan : int
18
+ number to replace unexpected values (e.g., -infinity) with
19
+ default = 0.0
20
+ catch_edgeless_node: Boolean
21
+ raise ValueError if node degree is zero
22
+ default = True
16
23
17
24
------
18
25
Returns
19
26
------
20
- Dictionary of the within community degree of each node.
27
+ within_community_degree: dict
28
+ Dictionary of the within community degree of each node.
21
29
22
30
'''
23
31
wc_dict = {}
@@ -48,14 +56,19 @@ def participation_coefficient(weighted_partition, catch_edgeless_node=True):
48
56
------
49
57
Parameters
50
58
------
51
- weighted_partition = Louvain Weighted Partition
52
- catch_edgeless_node = raise ValueError if node degree is zero
59
+ weighted_partition: Louvain Weighted Partition
60
+ louvain = weighted_modularity.wm.LouvainCommunityDetection()
61
+ weighted_partitions = louvain.run()
62
+ weighted_partition = weighted_partition[0], where index is the partition level
63
+ catch_edgeless_node: Boolean
64
+ raise ValueError if node degree is zero
65
+ default = True
53
66
54
67
------
55
68
Returns
56
69
------
57
- Dictionary of the participation coefficient for each node.
58
-
70
+ participation_coefficient: dict
71
+ Dictionary of the participation coefficient of each node.
59
72
'''
60
73
pc_dict = {}
61
74
graph = weighted_partition .graph
0 commit comments