easygraph.functions.basic.localassort module#

easygraph.functions.basic.localassort.localAssort(edgelist, node_attr, pr=array([0., 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]), undir=True, missingValue=-1)[source]#

Calculate the multiscale assortativity. You must ensure that the node index and node attribute index start from 0 :param edgelist: the network represented as an edge list,

i.e., a E x 2 array of node pairs

Parameters:
  • node_attr (array_like) – n length array of node attribute values

  • pr (array, optional) – array of one minus restart probabilities for the random walk in calculating the personalised pagerank. The largest of these values determines the accuracy of the TotalRank vector max(pr) -> 1 is more accurate (default: [0, .1, .2, .3, .4, .5, .6, .7, .8, .9])

  • undir (bool, optional) – indicate if network is undirected (default: True)

  • missingValue (int, optional) – token to indicate missing attribute values (default: -1)

Returns:

  • assortM (array_like) – n x len(pr) array of local assortativities, each column corresponds to a value of the input restart probabilities, pr. Note if only number of restart probabilties is greater than one (i.e., len(pr) > 1).

  • assortT (array_like) – n length array of multiscale assortativities

  • Z (array_like) – N length array of per-node confidence scores

References

For full details see [R14867b7dbf40-1] .. [R14867b7dbf40-1] Peel, L., Delvenne, J. C., & Lambiotte, R. (2018). “Multiscale

mixing patterns in networks.’ PNAS, 115(16), 4057-4062.