Error using JMI. MI is always negative?!
Opened this issue · 2 comments
Hi Daniel;
Thanks for sharing the code!
I was trying to work with the Pima Indians Diabetes Data Set as example but I get the "ValueError: All-NaN slice encountered".
Digging a bit into the code, I found out that the MI calculated within the mi_dc function in the mi.py file is always negative so I always get NAN number what makes impossible any calculation.
Any idea?
Here is the script I am using for the example
import numpy as np
import urllib
url = "http://archive.ics.uci.edu/ml/machine-learning-databases/pima-indians-diabetes/pima-indians-diabetes.data"
raw_data = urllib.urlopen(url)
dataset = np.loadtxt(raw_data, delimiter=",")
X = dataset[:,0:8]
y = dataset[:,8]
MIFS = mifs.MutualInformationFeatureSelector(method='JMI' ,verbose=0, n_features = 8)
y_int = y.astype(np.int64)
MIFS.fit(X,y_int)
Hi @PeterMcGor,
really sorry for the slow response.. I tried your example and you're right I get the same error which is really weird.. I don't really have an answer for this.. If you manage to debug it or get to the bottom of it I'd be very grateful for a PR.
many thanks,
d
Can you please try the latest version of the code and report back if you still encounter the bug? Thanks!