File Exchange

image thumbnail

Normalized Mutual Information

version 1.0.0.0 (734 Bytes) by Mo Chen
Fully vectorized implementation NMI. NMI is often used for evaluating clustering results.

15 Downloads

Updated 07 Mar 2016

View License

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).

Comments and Ratings (17)

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?

ahmed silik

I need description of the inputs especially the function sparse

Albert Pun

Would appreciate more comments and some examples

Hi,
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.

Ori

Hello,
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

bao dinh

a

Kelvin Wong

It doesn't work for large matrix as it rans out of memory in line 16 and 17.

yang

Eric Chen

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.

Thanks
Ali

NR P

I agree, an example... and a little description of the inputs would be strongly appreciated! Thank you!

Zhi

Could you provide some examples of running your code to prove it is correct?

Updates

1.0.0.0

minor tweak

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux

nmi/