Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using JMI. MI is always negative?! #9

Open
PeterMcGor opened this issue Jan 24, 2017 · 2 comments
Open

Error using JMI. MI is always negative?! #9

PeterMcGor opened this issue Jan 24, 2017 · 2 comments

Comments

@PeterMcGor
Copy link

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)
@danielhomola
Copy link
Owner

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

@danielhomola
Copy link
Owner

Can you please try the latest version of the code and report back if you still encounter the bug? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants