easygraph.functions.structural_holes.SHII_metric module#
- class easygraph.functions.structural_holes.SHII_metric.NodeParams(active, inWeight, threshold)[source]#
Bases:
object
- easygraph.functions.structural_holes.SHII_metric.structural_hole_influence_index(G_original, S, C, model, variant=False, seedRatio=0.05, randSeedIter=10, countIterations=100, Directed=True)[source]#
Returns the SHII metric of each seed.
- Parameters:
G_original (easygraph.Graph or easygraph.DiGraph) –
S (list of int) – A list of nodes which are structural hole spanners.
C (list of list) – Each list includes the nodes in one community.
model (string) – Propagation Model. Should be IC or LT.
variant (bool, default is False) – Whether returns variant SHII ml_metrics or not. variant SHII = # of the influenced outsider / # of the influenced insiders SHII = # of the influenced outsiders / # of the total influenced nodes
seedRatio (float, default is 0.05) – # of sampled seeds / # of nodes of the community that the given SHS belongs to.
randSeedIter (int, default is 10) – How many iterations to sample seeds.
countIterations (int default is 100) – Number of monte carlo simulations to be used.
Directed (bool, default is True) – Whether the graph is directed or not.
- Returns:
seed_shii_pair – the SHII metric of each seed
- Return type:
dict
Examples
# >>> structural_hole_influence_index(G, [3, 20, 9], Com, ‘LT’, seedRatio=0.1, Directed=False)
References