Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
entropic anm codes so far
  • Loading branch information
kbudhath committed May 28, 2018
1 parent 5566b44 commit 6259733
Show file tree
Hide file tree
Showing 13 changed files with 30,683 additions and 30,340 deletions.
2 changes: 1 addition & 1 deletion cisc.py
Expand Up @@ -11,7 +11,7 @@

__author__ = "Kailash Budhathoki"
__email__ = "kbudhath@mpi-inf.mpg.de"
__copyright__ = "Copyright (c) 2017"
__copyright__ = "Copyright (c) 2018"
__license__ = "MIT"


Expand Down
26 changes: 5 additions & 21 deletions crisp.py
Expand Up @@ -6,28 +6,14 @@
import sys
import time

from acid import map_to_majority, marginals
from sc import stochastic_complexity


def marginals(X, Y):
Ys = defaultdict(list)
for i, x in enumerate(X):
Ys[x].append(Y[i])
return Ys


def map_to_majority(X, Y):
f = dict()
subgroups_y = defaultdict(list)

for i, x in enumerate(X):
subgroups_y[x].append(Y[i])

for x, subgroup_y in subgroups_y.iteritems():
freq_y, _ = Counter(subgroup_y).most_common(1)[0]
f[x] = freq_y

return f
__author__ = "Kailash Budhathoki"
__email__ = "kbudhath@mpi-inf.mpg.de"
__copyright__ = "Copyright (c) 2018"
__license__ = "MIT"


def regress(X, Y):
Expand All @@ -48,7 +34,6 @@ def regress(X, Y):
j = 0
minimized = True
while j < max_iterations and minimized:
random.shuffle(supp_x)
minimized = False

for x_to_map in supp_x:
Expand Down Expand Up @@ -135,4 +120,3 @@ def test():
from test_benchmark import load_pair
X, Y = load_pair(99)
print crisp(X, Y)

68 changes: 0 additions & 68 deletions crispe.py

This file was deleted.

0 comments on commit 6259733

Please sign in to comment.