ftheberge / graph-partition-and-measures

Python code implementing a stable ensemble-based graph partition algorithm (ecg) and 11 graph-aware measures (gam) for comparing graph partitions.
MIT License
26 stars 1 forks source link

Alternate Graph Partition Measures #2

Open BradKML opened 3 years ago

BradKML commented 3 years ago

For NMI-like Partition Comparators, there are some table that can give reference

For pair-counting:

BradKML commented 3 years ago
ARI = a - (a+b)*(a+c)/total
Baulieu_1 = 1- (total*(b+c)+(b-c)**2)/(total**2)
Baulieu_2 = 1- (a*d+b*c)/(total**2)
Correlation_Coefficient = (a*d-b*c)/sqrt((a+b)*(a+c)*(c+d)*(b+d))
Czekanowski = 2*a/(2*a+b+c)
Fager_McGowan = a/sqrt((a+b)*(c+d))-1/(2*sqrt(a+b)) # Asymmetric
Fowlkes_Mallows = a/sqrt((a+b)*(a+c))
Gamma = (total*a-(a+b)*(a+c))/sqrt((a+b)*(a+c)*(c+d)*(b+d))
Goodman_Kruskal = (a*d-b*c)/(a*d+b*c)
Gower_Legendre = (a+d)/(a+(b+c)/2+d)
Hamann = ((a+d)-(b+c))/total
Hubert = (a+d)-(b+c)/total
Jaccard = a/(a+b+c)
Kulczynski = (a/(a+b)+a/(a+c))/2
McConnaughey = (a**2-b*c)/((a-b)*(a+c)) # Asymmetric
Minkowski = sqrt((b+c)/(a+b)) # Asymmetric
Mirkin = 2*(b+c)/total
Pearson = (a*d-b*c)/((a+b)*(a+c)*(c+d)*(b+d))
Pierce = (a*d-b*c)/((a+c)*(b+d))
Rand = (a+d)/total
Russel_Rao = a/total
Rogers_Tanimoto = (a+d)/(a+2(b+c)+d)
Sokal_Sneath_1 = (a/(a+b)+a/(a+c)+d/(b+d)+d/(c+d))/4
Sokal_Sneath_2 = a/(a+2*(b+c))
Sokal_Sneath_3 = (a*d)/sqrt((a+b)*(a+c)*(c+d)*(b+d))
Wallance = a/(a+b) # Asymmetric
Yule = ((a*d)-(b*c))/((a*b)-(c+d)) # Asymmetric