Created
February 4, 2015 10:36
-
-
Save FedericoV/7d08ef6e173f030bb611 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@numba.jit(target='cpu', nopython=True) | |
def fast_simpson(i, j): | |
a = 0 | |
b = 0 | |
c = 0 | |
M = i.shape[0] | |
for idx in range(M): | |
a += (i[idx] == 1) and (j[idx] == 1) | |
b += (i[idx] == 1) and (j[idx] == 0) | |
c += (i[idx] == 0) and (j[idx] == 1) | |
return 1 - (a / float(min((a + b), (a +c)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment