The clustering module

Clustering class.

class hcga.features.clustering.Clustering(graph=None)[source]

Clustering class.

Here we construct features based on the number of triangles in a graph.

Uses networkx, see ‘https://networkx.github.io/documentation/stable/reference/ algorithms/clustering.html`

We compute: The number of triangles Transitivity 1 Clustering 2 3 4

References

1

Biggs, Norman (1993). Algebraic Graph Theory (2nd ed.). Cambridge: Cambridge University Press. p. 118.

2

Generalizations of the clustering coefficient to weighted complex networks by J. Saramäki, M. Kivelä, J.-P. Onnela, K. Kaski, and J. Kertész, Physical Review E, 75 027105 (2007). http://jponnela.com/web_documents/a9.pdf

3

Intensity and coherence of motifs in weighted complex networks by J. P. Onnela, J. Saramäki, J. Kertész, and K. Kaski, Physical Review E, 71(6), 065103 (2005).

4

Clustering in complex directed networks by G. Fagiolo, Physical Review E, 76(2), 026107 (2007).

Initialise a feature class.

Parameters

graph (Graph) – graph for initialisation, converted to given encoding

compute_features()[source]

Main feature extraction function.

This function should be used by each specific feature class to add new features.

hcga.features.clustering.clustering_dist(graph)[source]
hcga.features.clustering.square_clustering_dist(graph)[source]
hcga.features.clustering.triang(graph)[source]