lingpy.thirdparty.linkcomm package¶
Submodules¶
lingpy.thirdparty.linkcomm.link_clustering module¶
- changes 2010-08-27:
all three output files now contain the same community id numbers
comm2nodes and comm2edges both present the cid as the first
entry of each line. Previously only comm2nodes did this. * implemented weighted version, added ‘-w’ switch * expanded help string to explain input and outputs
- lingpy.thirdparty.linkcomm.link_clustering.Dc(m, n)¶
partition density
- class lingpy.thirdparty.linkcomm.link_clustering.HLC(adj, edges)¶
Bases:
object
- initialize_edges()¶
- merge_comms(edge1, edge2)¶
- single_linkage(threshold=None, w=None)¶
- lingpy.thirdparty.linkcomm.link_clustering.similarities_unweighted(adj)¶
Get all the edge similarities. Input dict maps nodes to sets of neighbors. Output is a list of decorated edge-pairs, (1-sim,eij,eik), ordered by similarity.
- lingpy.thirdparty.linkcomm.link_clustering.similarities_weighted(adj, ij2wij)¶
Same as similarities_unweighted but using tanimoto coefficient. `adj’ is a dict mapping nodes to sets of neighbors, ij2wij is a dict mapping an edge (ni,nj) tuple to the weight wij of that edge.
- lingpy.thirdparty.linkcomm.link_clustering.swap(a, b)¶
Module contents¶
Module provides a simple py3 port for link community analyses, following the algorithm by James Bagrow, Yong-Yeol Ahn.