From d99879dc3d6839b00f4b325320fe2b992391b915 Mon Sep 17 00:00:00 2001 From: Ben Green Date: Mon, 22 Jun 2015 13:38:12 -0400 Subject: Added ml3, where we don’t consider edges from victims to non-victims. Also playing around with only allowing most likely parent to try and infect. Still working to see if some variant produces good results that allow us to determine seeds/non-seeds. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- experiments/process.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'experiments/process.py') diff --git a/experiments/process.py b/experiments/process.py index 49fe7a0..40bc9f3 100644 --- a/experiments/process.py +++ b/experiments/process.py @@ -1,6 +1,7 @@ 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 @@ -12,18 +13,18 @@ if __name__ == "__main__": sys.exit("usage: {0} ".format(sys.argv[0])) root_victims, victims, non_victims, age = load(open(sys.argv[1])) - # # alphas = np.arange(5e-4, 3e-3, 1e-4) # parameter of the time component - # alphas = np.logspace(-5,-1,num=20) - # # deltas = np.arange(0.03, 0.1, 0.005) # parameter of the structural component - # deltas = np.logspace(-5,-1,num=20) - # with open("out.log", "w") as fh: - # for alpha, delta in product(alphas, deltas): - # beta, roots, ll = ml2(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(5e-4, 3e-3, 1e-4) # parameter of the time component + alphas = np.logspace(-4,2,num=20) + # deltas = np.arange(0.03, 0.1, 0.005) # parameter of the structural component + deltas = np.logspace(-4,-1,num=10) + 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() - alpha = 0.004 - delta = 0.06 - beta, roots, ll = ml2(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 + # alpha = 0.0028 + # delta = 0.06 + # beta, roots, ll = ml2(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 -- cgit v1.2.3-70-g09d2