Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
dc decision criteria fixed
  • Loading branch information
kbudhath committed Feb 14, 2017
1 parent fea61e4 commit eace075
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions test_benchmark.py
Expand Up @@ -66,6 +66,13 @@ def load_tubingen_pairs():
yield load_tubingen_pair(pair)


def preprocess_dc_style(X, scale_factor=20):
if abs(max(X)) < 1:
X = np.multiply(X, scale_factor)
X = map(round, X)
return X


def test_tubingen_pairs():
epsilon = 0.0
level = 0.05
Expand All @@ -86,6 +93,10 @@ def test_tubingen_pairs():
continue

X, Y = data
# if i+1 in [65, 66, 67]:
# X, Y = preprocess_dc_style(X, 100), preprocess_dc_style(Y, 100)
# else:
# X, Y = preprocess_dc_style(X), preprocess_dc_style(Y)
# X, Y = normalise(X), normalise(Y)
# discretizer = UnivariateIPDiscretizer(X, Y)
# aX, Xd, aY, Yd = discretizer.discretize()
Expand All @@ -106,9 +117,9 @@ def test_tubingen_pairs():
else:
cause_cisc = ""

if dc_score[0] > dc_score[1]:
if dc_score[0] < dc_score[1]:
cause_dc = "X"
elif dc_score[0] < dc_score[1]:
elif dc_score[0] > dc_score[1]:
cause_dc = "Y"
else:
cause_dc = ""
Expand Down Expand Up @@ -170,7 +181,7 @@ def test_tubingen_pairs():
accs_cisc.append(sum(rcisc) / len(rcisc))
accs_dc.append(sum(rdc) / len(rdc))
accs_dr.append(sum(rdr) / len(rdr))
fp.write("%.2f %.2f %.2f %.2f" % (r, sum(rdc) / len(rdc),
fp.write("%.2f %.2f %.2f %.2f\n" % (r, sum(rdc) / len(rdc),
sum(rdr) / len(rdr), sum(rcisc) / len(rcisc)))
fp.close()
plot_multiline([accs_cisc, accs_dc, accs_dr], dec_rate, [
Expand Down

0 comments on commit eace075

Please sign in to comment.