summaryrefslogtreecommitdiffstats
path: root/experiments/process.py
diff options
context:
space:
mode:
authorBen Green <ben@SEASITs-MacBook-Pro.local>2015-06-11 21:27:14 -0400
committerBen Green <ben@SEASITs-MacBook-Pro.local>2015-06-11 21:27:14 -0400
commit1143cf60812c37957c81d39d6180921460e62901 (patch)
tree5231b7fe4f3e27d00072d652297208660e47bb5a /experiments/process.py
parent18aa2dd933f4c76ebd374b42fa10d0067870f135 (diff)
downloadcriminal_cascades-1143cf60812c37957c81d39d6180921460e62901.tar.gz
started adding weights into edge probabilities
Diffstat (limited to 'experiments/process.py')
-rw-r--r--experiments/process.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/experiments/process.py b/experiments/process.py
index 5c4c215..98406d6 100644
--- a/experiments/process.py
+++ b/experiments/process.py
@@ -11,11 +11,11 @@ if __name__ == "__main__":
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., 100.) # parameter of the time component
- delta = np.arange(0.01, 0.9, 0.1) # parameter of the structural component
+ alphas = 1. / np.arange(1., 4000., 50.) # parameter of the time component
+ deltas = np.arange(0.01, 0.3, 0.05) # 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 "\t".join(map(str, [a, d, beta, roots, ll, exp(ll)]))
- fh.write("\t".join(map(str, [a, d, beta, roots, ll])) + "\n")
+ for alpha, delta in product(alphas, deltas):
+ beta, roots, ll = ml(root_victims, victims, non_victims, age, alpha, delta)
+ print "\t".join(map(str, [1/alpha, delta, beta, roots, ll, exp(ll)]))
+ fh.write("\t".join(map(str, [alpha, delta, beta, roots, ll])) + "\n")
fh.flush()