diff options
| author | Ben Green <ben@SEASITs-MacBook-Pro.local> | 2015-06-11 18:20:55 -0400 |
|---|---|---|
| committer | Ben Green <ben@SEASITs-MacBook-Pro.local> | 2015-06-11 18:20:55 -0400 |
| commit | 18aa2dd933f4c76ebd374b42fa10d0067870f135 (patch) | |
| tree | c4e65d27ea78e5ec02ebc983734746d4433c6fe0 /experiments/process.py | |
| parent | 85e4d58fb38b8190c7e2a6bc3961723a65e84c86 (diff) | |
| download | criminal_cascades-18aa2dd933f4c76ebd374b42fa10d0067870f135.tar.gz | |
cleaned up code with some minor changes
Diffstat (limited to 'experiments/process.py')
| -rw-r--r-- | experiments/process.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/experiments/process.py b/experiments/process.py index ec25d8e..5c4c215 100644 --- a/experiments/process.py +++ b/experiments/process.py @@ -6,21 +6,16 @@ from itertools import product from math import exp -def print_ll(alpha, delta): - beta, roots, ll = ml(root_victims, victims, non_victims, alpha, delta) - print "\t".join(map(str, [alpha, delta, beta, roots, ll, exp(ll)])) + "\n" - - if __name__ == "__main__": 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])) - alpha = 1. / np.arange(1., 1000., 10.) # parameter of the time component - delta = np.arange(0.01, 0.9, 0.03) # parameter of the structural component - with open("out.log", "a") as fh: + alpha = 1. / np.arange(1., 1000., 100.) # parameter of the time component + delta = np.arange(0.01, 0.9, 0.1) # parameter of the structural component + with open("out.log", "w") as fh: for a, d in product(alpha, delta): beta, roots, ll = ml(root_victims, victims, non_victims, age, a, d) - print beta + print "\t".join(map(str, [a, d, beta, roots, ll, exp(ll)])) fh.write("\t".join(map(str, [a, d, beta, roots, ll])) + "\n") fh.flush() |
