fixed discovRe errors
This commit is contained in:
parent
3206714241
commit
aae437a3a1
24
raw-feature-extractor/graph_property.py
Normal file
24
raw-feature-extractor/graph_property.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import networkx as nx
|
||||||
|
import pdb
|
||||||
|
def betweeness(g):
|
||||||
|
#pdb.set_trace()
|
||||||
|
betweenness = nx.betweenness_centrality(g)
|
||||||
|
return betweenness
|
||||||
|
|
||||||
|
def eigenvector(g):
|
||||||
|
centrality = nx.eigenvector_centrality(g)
|
||||||
|
return centrality
|
||||||
|
|
||||||
|
def closeness_centrality(g):
|
||||||
|
closeness = nx.closeness_centrality(g)
|
||||||
|
return closeness
|
||||||
|
|
||||||
|
def retrieveGP(g):
|
||||||
|
bf = betweeness(g)
|
||||||
|
#close = closeness_centrality(g)
|
||||||
|
#bf_sim =
|
||||||
|
#close_sim =
|
||||||
|
x = sorted(bf.values())
|
||||||
|
value = sum(x)/len(x)
|
||||||
|
return round(value,5)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user