diff options
Diffstat (limited to 'experiments/process.py')
| -rw-r--r-- | experiments/process.py | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/experiments/process.py b/experiments/process.py index b5e0d6d..f31e0d4 100644 --- a/experiments/process.py +++ b/experiments/process.py @@ -1,27 +1,44 @@ import sys from ml import ml +from ml2 import ml2 +from ml3 import ml3 import numpy as np from cPickle import load from itertools import product from math import exp +import time if __name__ == "__main__": + time.sleep(3) if len(sys.argv) < 2: sys.exit("usage: {0} <file>".format(sys.argv[0])) root_victims, victims, non_victims, age = load(open(sys.argv[1])) - # alphas = 1. / np.arange(1000., 10000., 50.) # parameter of the time component - alphas = np.logspace(-2,2,num=5) - deltas = np.logspace(-10,-1,num=10)#np.arange(0.000001, 0.005, 0.001) # parameter of the structural component + # 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 = ml(root_victims, victims, non_victims, age, alpha, delta) + 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 = 20000. - # delta = .5 - # beta, roots, ll = ml(root_victims, victims, non_victims, age, alpha, delta) - # print "\t".join(map(str, [1./alpha, delta, beta, roots, ll]))
\ No newline at end of file + # 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) + # 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 = 0.061 + # delta = 0.082 + # 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 |
