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

Cythonized expected_mutual_information disagrees with former version #6718

Closed
jnothman opened this issue Apr 26, 2016 · 1 comment
Closed
Labels

Comments

@jnothman
Copy link
Member

jnothman commented Apr 26, 2016

This SO post appears to highlight a long-standing bug introduced in 9cf5f00, shortly after expected_mutual_information was rewritten in cython. See #1334

Using the SO poster's data:

import urllib  # py2
import ast
import numpy as np
from sklearn.metrics import cluster
pred = np.array(ast.literal_eval(urllib.urlopen('http://pastebin.com/raw/hJz1M4sf').read()))
true = np.array(ast.literal_eval(urllib.urlopen('http://pastebin.com/raw/9Y5TE6b7').read()))
print(cluster.expected_mutual_information(cluster.contingency_matrix(pred,true), len(pred)))

output prior to 9cf5f00: 0.000307845374016.

output since 9cf5f00: 1.53843820095.

@jnothman jnothman added the Bug label Apr 26, 2016
@jnothman
Copy link
Member Author

jnothman commented Apr 26, 2016

Huh. Now I can't replicate it. Might not be due to 09714bc; might have been a recompilation problem. EDIT: updated description now that I discovered "dirty fix" in 9cf5f00 was culprit.

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

No branches or pull requests

1 participant