summaryrefslogtreecommitdiffstats
path: root/experiments/plot.py
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2015-03-09 13:26:28 -0400
committerThibaut Horel <thibaut.horel@gmail.com>2015-03-09 13:26:28 -0400
commit9f2325a10775088029d53303d8e727e242d1c742 (patch)
treeb72a16361938d6ec14783951987eb57a0853bb57 /experiments/plot.py
parent7c73e6461e36c646a9cb7e9d272c6d90b189190d (diff)
downloadcriminal_cascades-9f2325a10775088029d53303d8e727e242d1c742.tar.gz
Adding experiments code
Diffstat (limited to 'experiments/plot.py')
-rw-r--r--experiments/plot.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/experiments/plot.py b/experiments/plot.py
new file mode 100644
index 0000000..cbea485
--- /dev/null
+++ b/experiments/plot.py
@@ -0,0 +1,21 @@
+from mpl_toolkits.mplot3d import Axes3D
+from matplotlib import cm
+import matplotlib.pyplot as plt
+import numpy as np
+
+with open("results3.txt") as fh:
+ values = [map(float, line.strip().split()) for line in fh]
+ #values = [(b, a, l) for (b, a, l) in values if b >= 0.04]
+ am = max(values, key=lambda x: x[2])
+ print am
+ beta, alpha, l = zip(*values)
+
+ fig = plt.figure(figsize=(12, 8))
+ ax = fig.gca(projection='3d')
+
+ ax.plot_trisurf(beta, alpha, l, cmap=cm.jet, linewidth=0.001)
+ plt.xlabel("Beta")
+ plt.ylabel("Alpha")
+ ax.set_zlabel('Likelihood')
+ #plt.savefig("ll.pdf")
+ plt.show()