Normalized mutual information is often used for evaluating clustering results, information retrieval, feature selection etc. This is a optimized implementation of the function which has no for loops.
This function is now a part of the PRML toolbox (http://www.mathworks.com/matlabcentral/fileexchange/55826-pattern-recognition-and-machine-learning-toolbox).
Mo Chen (2020). Normalized Mutual Information (https://www.mathworks.com/matlabcentral/fileexchange/29047-normalized-mutual-information), MATLAB Central File Exchange. Retrieved .
I am wondering to ask why the result is always 0 or 1? NMI result should be [0,1]. The code seems buggy! Anyone could please give some examples to show the validity of the code?
I need description of the inputs especially the function sparse
Would appreciate more comments and some examples
I am trying to find similarities between two signals obtained from two different modalities and sampling frequencies.Hence tried the mutual information code. but i get an error : 'Error using sparse
Sparse matrix sizes must be non-negative integers less than MAXSIZE as defined by COMPUTER. Use HELP COMPUTER for more details.
Error in nmi (line 20)
Mx = sparse(idx,x,1,n,k,n);'
Please help me correct this error.
Why is it important to verify the integrity of results, i.e. length(labels)==length(results)?
Isn't it possible to use nmi for clustering with k that is different from number of labels?
I changed the script for my use so that it will accept this. should I upload?
please add more comments, especially for the inputs. Thanks
It doesn't work for large matrix as it rans out of memory in line 16 and 17.
grateful if more comments provided
Good job, I used your function to validate mine :). Sometime in research you cannot trust even yourself.
Can you give a detailed docomented .m file so that we can have a easy understanding of NMI.
I agree, an example... and a little description of the inputs would be strongly appreciated! Thank you!
Could you provide some examples of running your code to prove it is correct?
Inspired by: Pattern Recognition and Machine Learning Toolbox
Inspired: Information Theory Toolbox