This program calculates the adjusted mutual information for comparing clusterings. It includes:
- The mutual information/adjusted mutual information
- The Rand index and some other indices
 Vinh, N. X.; Epps, J.; Bailey, J. (2009). "Information theoretic measures for clusterings comparison". Proceedings of the 26th Annual International Conference on Machine Learning - ICML '09
 Vinh, Nguyen Xuan; Epps, Julien; Bailey, James (2010), "Information Theoretic Measures for Clusterings Comparison: Variants, Properties, Normalization and Correction for Chance", The Journal of Machine Learning Research 11 (Oct): 2837-54
Xuan Vinh Nguyen (2021). The Adjusted Mutual Information (https://www.mathworks.com/matlabcentral/fileexchange/33144-the-adjusted-mutual-information), MATLAB Central File Exchange. Retrieved .
If you would like to improve the accuracy of the calculated Expected MI, I recommend replacing the factorial calculations with the log gamma function, gammaln(N+1) = log(N!). This allows accurate calculations with much larger values of N and N=0.
>> logfact = @(x) gammaln(x+1);
>> exp( logfact(10000) - logfact(9990) )
>> factorial(10000) ./ factorial(9990)
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!