dgl.linkx_homophilyΒΆ
-
dgl.
linkx_homophily
(graph, y)[source]ΒΆ Homophily measure from Large Scale Learning on Non-Homophilous Graphs: New Benchmarks and Strong Simple Methods
Mathematically it is defined as follows:
1Cβ1Cβk=1max(0,βvβCk|{uβN(v):yv=yu}|βvβCk|N(v)|β|Ck||V|),where C is the number of node classes, Ck is the set of nodes that belong to class k, N(v) are the predecessors of node v, yv is the class of node v, and V is the set of nodes.
- Parameters
- Returns
The homophily value.
- Return type
Examples