summaryrefslogtreecommitdiffstats
path: root/experiments/process.py
diff options
context:
space:
mode:
authorBen Green <ben@SEASITs-MacBook-Pro.local>2015-07-01 00:49:23 -0400
committerBen Green <ben@SEASITs-MacBook-Pro.local>2015-07-01 00:49:23 -0400
commit8e09ca6ca68c71bdab65525b529e2adfa281823c (patch)
treed395bfcb0f9f0bc1092072ae1a8a9d3ad9c98a4a /experiments/process.py
parent6e527bbf612465bf5d739b9652abc0165550993c (diff)
downloadcriminal_cascades-8e09ca6ca68c71bdab65525b529e2adfa281823c.tar.gz
Got predict-victims running in parallel, drastically reducing the time
for each test. Also changed how we get the rankings of infected individuals each day.
Diffstat (limited to 'experiments/process.py')
-rw-r--r--experiments/process.py42
1 files changed, 21 insertions, 21 deletions
diff --git a/experiments/process.py b/experiments/process.py
index f31e0d4..0115bd4 100644
--- a/experiments/process.py
+++ b/experiments/process.py
@@ -15,30 +15,30 @@ if __name__ == "__main__":
sys.exit("usage: {0} <file>".format(sys.argv[0]))
root_victims, victims, non_victims, age = load(open(sys.argv[1]))
- # alphas = np.arange(1e-3, 1e-2, 8e-4) # parameter of the time component
- alphas = np.logspace(-4,-1,num=15)
- # deltas = np.arange(0.001, 0.3, 0.008) # parameter of the structural component
- deltas = np.logspace(-4,-1.7,num=15)
- with open("out.log", "w") as fh:
- for alpha, delta in product(alphas, deltas):
- beta, roots, ll = ml3(root_victims, victims, non_victims, age, alpha, delta)
- print "\t".join(map(str, [alpha, delta, beta, roots, ll]))
- fh.write("\t".join(map(str, [alpha, delta, beta, roots, ll])) + "\n")
- fh.flush()
-
- # alphas = np.arange(.04, .075, .003) # parameter of the time component
- # # alphas = np.logspace(-4,-1,num=20)
- # deltas = np.arange(.07, .11, .003) # parameter of the structural component
- # # deltas = np.logspace(-2,-.5,num=20)
- # lmbda = 0.10#np.logspace(-12,-3,num=10)
+ # # alphas = np.arange(1e-3, 1e-2, 8e-4) # parameter of the time component
+ # alphas = np.logspace(-4,-1,num=15)
+ # # deltas = np.arange(0.001, 0.3, 0.008) # parameter of the structural component
+ # deltas = np.logspace(-4,-1.7,num=15)
# with open("out.log", "w") as fh:
# for alpha, delta in product(alphas, deltas):
- # lmbda, roots, ll = ml2(root_victims, victims, non_victims, alpha, delta, lmbda)
- # print "\t".join(map(str, [alpha, delta, lmbda, roots, ll]))
- # fh.write("\t".join(map(str, [alpha, delta, lmbda, roots, ll])) + "\n")
+ # beta, roots, ll = ml3(root_victims, victims, non_victims, age, alpha, delta)
+ # print "\t".join(map(str, [alpha, delta, beta, roots, ll]))
+ # fh.write("\t".join(map(str, [alpha, delta, beta, roots, ll])) + "\n")
# fh.flush()
- # alpha = 0.061
- # delta = 0.082
+ alphas = np.arange(.15, .25, .01) # parameter of the time component
+ # alphas = np.logspace(-4,-.5,num=15)
+ deltas = np.arange(.08, .1, .01) # parameter of the structural component
+ # deltas = np.logspace(-2,-.1,num=15)
+ lmbda = 0.10#np.logspace(-12,-3,num=10)
+ with open("out.log", "w") as fh:
+ for alpha, delta in product(alphas, deltas):
+ lmbda, roots, ll = ml2(root_victims, victims, non_victims, alpha, delta, lmbda)
+ print "\t".join(map(str, [alpha, delta, lmbda, roots, ll]))
+ fh.write("\t".join(map(str, [alpha, delta, lmbda, roots, ll])) + "\n")
+ fh.flush()
+
+ # alpha = .016
+ # delta = 0.077
# beta, roots, ll = ml2(root_victims, victims, non_victims, alpha, delta, 1.)
# print "\t".join(map(str, [alpha, delta, beta, roots, ll])) \ No newline at end of file