2011/10/14 Robert Layton <[email protected]>: > I'm working on adding Adjusted Mutual Information, and need to calculate the > Mutual Information. > I think I have the algorithm itself correct, except for the fact that > whenever the contingency matrix is 0, a nan happens and propogates through > the code. > > Sample code on the net [1] uses an eps=np.finfo(float).eps. Should I do > this, adding eps to anything that is a denominator or parameter to log? > Is there a better way?
I would rather filter out any entry that has a 0.0 in the denominator before the final sum using array masking. BTW, thanks for tackling this. -- Olivier http://twitter.com/ogrisel - http://github.com/ogrisel ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2d-oct _______________________________________________ Scikit-learn-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
