Code covered by the BSD License  

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Normalized Mutual Information

  • nmi(x, y)Compute normalized mutual information I(x,y)/sqrt(H(x)*H(y)) of two discrete variables x and y.
  • View all files
4.4
4.4 | 5 ratings Rate this file 73 Downloads (last 30 days) File Size: 734 Bytes File ID: #29047 Version: 1.0

Normalized Mutual Information

by

Mo Chen (view profile)

 

15 Oct 2010 (Updated )

Fully vectorized implementation NMI. NMI is often used for evaluating clustering results.

| Watch this File

File Information
Description

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

Acknowledgements

Pattern Recognition And Machine Learning Toolbox inspired this file.

This file inspired Information Theory Toolbox.

MATLAB release MATLAB 9.0 (R2016a)
MATLAB Search Path
/
/nmi
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (12)
03 Jun 2016 Sowmya Ravindra

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.

Comment only
25 Mar 2015 samira rahimi  
15 Dec 2014 Ori

Ori (view profile)

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?

Comment only
11 Sep 2014 Jianxiong Chen

please add more comments, especially for the inputs. Thanks

Comment only
01 Jul 2014 bao dinh

a

Comment only
08 Nov 2013 Kelvin Wong

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

11 Aug 2013 yang

yang (view profile)

 
29 Dec 2011 Eric Chen

grateful if more comments provided

21 Nov 2011 Artur Abdullin

Good job, I used your function to validate mine :). Sometime in research you cannot trust even yourself.

07 Sep 2011 Md. Ali Hossain

Can you give a detailed docomented .m file so that we can have a easy understanding of NMI.

Thanks
Ali

Comment only
23 Jun 2011 NR P

NR P (view profile)

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

Comment only
23 Jun 2011 Zhi

Zhi (view profile)

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

Comment only
Updates
07 Mar 2016 1.0

minor tweak

Contact us