From 54613c1f9cf510ca7a71d6619418f2247515aec6 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 5 May 2015 14:15:21 -0400 Subject: Add models for time predictioAdd models for time prediction --- config/dest_simple_mlp_2_cs.py | 21 +++++++++++++++++++++ config/dest_simple_mlp_2_cswdt.py | 25 +++++++++++++++++++++++++ config/dest_simple_mlp_2_noembed.py | 18 ++++++++++++++++++ config/dest_simple_mlp_tgtcls_0_cs.py | 25 +++++++++++++++++++++++++ config/dest_simple_mlp_tgtcls_1_cs.py | 25 +++++++++++++++++++++++++ config/dest_simple_mlp_tgtcls_1_cswdt.py | 29 +++++++++++++++++++++++++++++ config/dest_simple_mlp_tgtcls_1_cswdtx.py | 30 ++++++++++++++++++++++++++++++ config/simple_mlp_2_cs.py | 21 --------------------- config/simple_mlp_2_cswdt.py | 25 ------------------------- config/simple_mlp_2_noembed.py | 18 ------------------ config/simple_mlp_tgtcls_0_cs.py | 25 ------------------------- config/simple_mlp_tgtcls_1_cs.py | 25 ------------------------- config/simple_mlp_tgtcls_1_cswdt.py | 29 ----------------------------- config/simple_mlp_tgtcls_1_cswdtx.py | 30 ------------------------------ config/time_simple_mlp_1.py | 19 +++++++++++++++++++ config/time_simple_mlp_2_cswdtx.py | 26 ++++++++++++++++++++++++++ 16 files changed, 218 insertions(+), 173 deletions(-) create mode 100644 config/dest_simple_mlp_2_cs.py create mode 100644 config/dest_simple_mlp_2_cswdt.py create mode 100644 config/dest_simple_mlp_2_noembed.py create mode 100644 config/dest_simple_mlp_tgtcls_0_cs.py create mode 100644 config/dest_simple_mlp_tgtcls_1_cs.py create mode 100644 config/dest_simple_mlp_tgtcls_1_cswdt.py create mode 100644 config/dest_simple_mlp_tgtcls_1_cswdtx.py delete mode 100644 config/simple_mlp_2_cs.py delete mode 100644 config/simple_mlp_2_cswdt.py delete mode 100644 config/simple_mlp_2_noembed.py delete mode 100644 config/simple_mlp_tgtcls_0_cs.py delete mode 100644 config/simple_mlp_tgtcls_1_cs.py delete mode 100644 config/simple_mlp_tgtcls_1_cswdt.py delete mode 100644 config/simple_mlp_tgtcls_1_cswdtx.py create mode 100644 config/time_simple_mlp_1.py create mode 100644 config/time_simple_mlp_2_cswdtx.py (limited to 'config') diff --git a/config/dest_simple_mlp_2_cs.py b/config/dest_simple_mlp_2_cs.py new file mode 100644 index 0000000..2cec78d --- /dev/null +++ b/config/dest_simple_mlp_2_cs.py @@ -0,0 +1,21 @@ +import model.dest_simple_mlp as model + +import data + +n_begin_end_pts = 5 # how many points we consider at the beginning and end of the known trajectory +n_end_pts = 5 + +n_valid = 1000 + +dim_embeddings = [ + ('origin_call', data.n_train_clients+1, 10), + ('origin_stand', data.n_stands+1, 10) +] + +dim_input = n_begin_end_pts * 2 * 2 + sum(x for (_, _, x) in dim_embeddings) +dim_hidden = [200, 100] +dim_output = 2 + +learning_rate = 0.0001 +momentum = 0.99 +batch_size = 32 diff --git a/config/dest_simple_mlp_2_cswdt.py b/config/dest_simple_mlp_2_cswdt.py new file mode 100644 index 0000000..f6ddf34 --- /dev/null +++ b/config/dest_simple_mlp_2_cswdt.py @@ -0,0 +1,25 @@ +import model.dest_simple_mlp as model + +import data + +n_begin_end_pts = 5 # how many points we consider at the beginning and end of the known trajectory +n_end_pts = 5 + +n_valid = 1000 + +dim_embeddings = [ + ('origin_call', data.n_train_clients+1, 10), + ('origin_stand', data.n_stands+1, 10), + ('week_of_year', 52, 10), + ('day_of_week', 7, 10), + ('qhour_of_day', 24 * 4, 10), + ('day_type', 3, 10), +] + +dim_input = n_begin_end_pts * 2 * 2 + sum(x for (_, _, x) in dim_embeddings) +dim_hidden = [200, 100] +dim_output = 2 + +learning_rate = 0.0001 +momentum = 0.99 +batch_size = 32 diff --git a/config/dest_simple_mlp_2_noembed.py b/config/dest_simple_mlp_2_noembed.py new file mode 100644 index 0000000..3832146 --- /dev/null +++ b/config/dest_simple_mlp_2_noembed.py @@ -0,0 +1,18 @@ +import model.dest_simple_mlp as model + +import data + +n_begin_end_pts = 5 # how many points we consider at the beginning and end of the known trajectory +n_end_pts = 5 + +n_valid = 1000 + +dim_embeddings = [] # do not use embeddings + +dim_input = n_begin_end_pts * 2 * 2 + sum(x for (_, _, x) in dim_embeddings) +dim_hidden = [200, 100] +dim_output = 2 + +learning_rate = 0.0001 +momentum = 0.99 +batch_size = 32 diff --git a/config/dest_simple_mlp_tgtcls_0_cs.py b/config/dest_simple_mlp_tgtcls_0_cs.py new file mode 100644 index 0000000..a8a5a0e --- /dev/null +++ b/config/dest_simple_mlp_tgtcls_0_cs.py @@ -0,0 +1,25 @@ +import cPickle + +import data + +import model.dest_simple_mlp_tgtcls as model + +n_begin_end_pts = 5 # how many points we consider at the beginning and end of the known trajectory +n_end_pts = 5 + +n_valid = 1000 + +with open(data.DATA_PATH + "/arrival-clusters.pkl") as f: tgtcls = cPickle.load(f) + +dim_embeddings = [ + ('origin_call', data.n_train_clients+1, 10), + ('origin_stand', data.n_stands+1, 10) +] + +dim_input = n_begin_end_pts * 2 * 2 + sum(x for (_, _, x) in dim_embeddings) +dim_hidden = [] +dim_output = tgtcls.shape[0] + +learning_rate = 0.0001 +momentum = 0.99 +batch_size = 32 diff --git a/config/dest_simple_mlp_tgtcls_1_cs.py b/config/dest_simple_mlp_tgtcls_1_cs.py new file mode 100644 index 0000000..8136f10 --- /dev/null +++ b/config/dest_simple_mlp_tgtcls_1_cs.py @@ -0,0 +1,25 @@ +import cPickle + +import data + +import model.dest_simple_mlp_tgtcls as model + +n_begin_end_pts = 5 # how many points we consider at the beginning and end of the known trajectory +n_end_pts = 5 + +n_valid = 1000 + +with open(data.DATA_PATH + "/arrival-clusters.pkl") as f: tgtcls = cPickle.load(f) + +dim_embeddings = [ + ('origin_call', data.n_train_clients+1, 10), + ('origin_stand', data.n_stands+1, 10) +] + +dim_input = n_begin_end_pts * 2 * 2 + sum(x for (_, _, x) in dim_embeddings) +dim_hidden = [500] +dim_output = tgtcls.shape[0] + +learning_rate = 0.0001 +momentum = 0.99 +batch_size = 32 diff --git a/config/dest_simple_mlp_tgtcls_1_cswdt.py b/config/dest_simple_mlp_tgtcls_1_cswdt.py new file mode 100644 index 0000000..af7b2a3 --- /dev/null +++ b/config/dest_simple_mlp_tgtcls_1_cswdt.py @@ -0,0 +1,29 @@ +import cPickle + +import data + +import model.dest_simple_mlp_tgtcls as model + +n_begin_end_pts = 5 # how many points we consider at the beginning and end of the known trajectory +n_end_pts = 5 + +n_valid = 1000 + +with open(data.DATA_PATH + "/arrival-clusters.pkl") as f: tgtcls = cPickle.load(f) + +dim_embeddings = [ + ('origin_call', data.n_train_clients+1, 10), + ('origin_stand', data.n_stands+1, 10), + ('week_of_year', 52, 10), + ('day_of_week', 7, 10), + ('qhour_of_day', 24 * 4, 10), + ('day_type', 3, 10), +] + +dim_input = n_begin_end_pts * 2 * 2 + sum(x for (_, _, x) in dim_embeddings) +dim_hidden = [500] +dim_output = tgtcls.shape[0] + +learning_rate = 0.0001 +momentum = 0.99 +batch_size = 32 diff --git a/config/dest_simple_mlp_tgtcls_1_cswdtx.py b/config/dest_simple_mlp_tgtcls_1_cswdtx.py new file mode 100644 index 0000000..b9832df --- /dev/null +++ b/config/dest_simple_mlp_tgtcls_1_cswdtx.py @@ -0,0 +1,30 @@ +import cPickle + +import data + +import model.dest_simple_mlp_tgtcls as model + +n_begin_end_pts = 5 # how many points we consider at the beginning and end of the known trajectory +n_end_pts = 5 + +n_valid = 1000 + +with open(data.DATA_PATH + "/arrival-clusters.pkl") as f: tgtcls = cPickle.load(f) + +dim_embeddings = [ + ('origin_call', data.n_train_clients+1, 10), + ('origin_stand', data.n_stands+1, 10), + ('week_of_year', 52, 10), + ('day_of_week', 7, 10), + ('qhour_of_day', 24 * 4, 10), + ('day_type', 3, 10), + ('taxi_id', 448, 10), +] + +dim_input = n_begin_end_pts * 2 * 2 + sum(x for (_, _, x) in dim_embeddings) +dim_hidden = [500] +dim_output = tgtcls.shape[0] + +learning_rate = 0.0001 +momentum = 0.99 +batch_size = 32 diff --git a/config/simple_mlp_2_cs.py b/config/simple_mlp_2_cs.py deleted file mode 100644 index fa2f4c1..0000000 --- a/config/simple_mlp_2_cs.py +++ /dev/null @@ -1,21 +0,0 @@ -import model.simple_mlp as model - -import data - -n_begin_end_pts = 5 # how many points we consider at the beginning and end of the known trajectory -n_end_pts = 5 - -n_valid = 1000 - -dim_embeddings = [ - ('origin_call', data.n_train_clients+1, 10), - ('origin_stand', data.n_stands+1, 10) -] - -dim_input = n_begin_end_pts * 2 * 2 + sum(x for (_, _, x) in dim_embeddings) -dim_hidden = [200, 100] -dim_output = 2 - -learning_rate = 0.0001 -momentum = 0.99 -batch_size = 32 diff --git a/config/simple_mlp_2_cswdt.py b/config/simple_mlp_2_cswdt.py deleted file mode 100644 index 05c9450..0000000 --- a/config/simple_mlp_2_cswdt.py +++ /dev/null @@ -1,25 +0,0 @@ -import model.simple_mlp as model - -import data - -n_begin_end_pts = 5 # how many points we consider at the beginning and end of the known trajectory -n_end_pts = 5 - -n_valid = 1000 - -dim_embeddings = [ - ('origin_call', data.n_train_clients+1, 10), - ('origin_stand', data.n_stands+1, 10), - ('week_of_year', 52, 10), - ('day_of_week', 7, 10), - ('qhour_of_day', 24 * 4, 10), - ('day_type', 3, 10), -] - -dim_input = n_begin_end_pts * 2 * 2 + sum(x for (_, _, x) in dim_embeddings) -dim_hidden = [200, 100] -dim_output = 2 - -learning_rate = 0.0001 -momentum = 0.99 -batch_size = 32 diff --git a/config/simple_mlp_2_noembed.py b/config/simple_mlp_2_noembed.py deleted file mode 100644 index 2f45f63..0000000 --- a/config/simple_mlp_2_noembed.py +++ /dev/null @@ -1,18 +0,0 @@ -import model.simple_mlp as model - -import data - -n_begin_end_pts = 5 # how many points we consider at the beginning and end of the known trajectory -n_end_pts = 5 - -n_valid = 1000 - -dim_embeddings = [] # do not use embeddings - -dim_input = n_begin_end_pts * 2 * 2 + sum(x for (_, _, x) in dim_embeddings) -dim_hidden = [200, 100] -dim_output = 2 - -learning_rate = 0.0001 -momentum = 0.99 -batch_size = 32 diff --git a/config/simple_mlp_tgtcls_0_cs.py b/config/simple_mlp_tgtcls_0_cs.py deleted file mode 100644 index 96faca0..0000000 --- a/config/simple_mlp_tgtcls_0_cs.py +++ /dev/null @@ -1,25 +0,0 @@ -import cPickle - -import data - -import model.simple_mlp_tgtcls as model - -n_begin_end_pts = 5 # how many points we consider at the beginning and end of the known trajectory -n_end_pts = 5 - -n_valid = 1000 - -with open(data.DATA_PATH + "/arrival-clusters.pkl") as f: tgtcls = cPickle.load(f) - -dim_embeddings = [ - ('origin_call', data.n_train_clients+1, 10), - ('origin_stand', data.n_stands+1, 10) -] - -dim_input = n_begin_end_pts * 2 * 2 + sum(x for (_, _, x) in dim_embeddings) -dim_hidden = [] -dim_output = tgtcls.shape[0] - -learning_rate = 0.0001 -momentum = 0.99 -batch_size = 32 diff --git a/config/simple_mlp_tgtcls_1_cs.py b/config/simple_mlp_tgtcls_1_cs.py deleted file mode 100644 index 293a0ab..0000000 --- a/config/simple_mlp_tgtcls_1_cs.py +++ /dev/null @@ -1,25 +0,0 @@ -import cPickle - -import data - -import model.simple_mlp_tgtcls as model - -n_begin_end_pts = 5 # how many points we consider at the beginning and end of the known trajectory -n_end_pts = 5 - -n_valid = 1000 - -with open(data.DATA_PATH + "/arrival-clusters.pkl") as f: tgtcls = cPickle.load(f) - -dim_embeddings = [ - ('origin_call', data.n_train_clients+1, 10), - ('origin_stand', data.n_stands+1, 10) -] - -dim_input = n_begin_end_pts * 2 * 2 + sum(x for (_, _, x) in dim_embeddings) -dim_hidden = [500] -dim_output = tgtcls.shape[0] - -learning_rate = 0.0001 -momentum = 0.99 -batch_size = 32 diff --git a/config/simple_mlp_tgtcls_1_cswdt.py b/config/simple_mlp_tgtcls_1_cswdt.py deleted file mode 100644 index 45bd39e..0000000 --- a/config/simple_mlp_tgtcls_1_cswdt.py +++ /dev/null @@ -1,29 +0,0 @@ -import cPickle - -import data - -import model.simple_mlp_tgtcls as model - -n_begin_end_pts = 5 # how many points we consider at the beginning and end of the known trajectory -n_end_pts = 5 - -n_valid = 1000 - -with open(data.DATA_PATH + "/arrival-clusters.pkl") as f: tgtcls = cPickle.load(f) - -dim_embeddings = [ - ('origin_call', data.n_train_clients+1, 10), - ('origin_stand', data.n_stands+1, 10), - ('week_of_year', 52, 10), - ('day_of_week', 7, 10), - ('qhour_of_day', 24 * 4, 10), - ('day_type', 3, 10), -] - -dim_input = n_begin_end_pts * 2 * 2 + sum(x for (_, _, x) in dim_embeddings) -dim_hidden = [500] -dim_output = tgtcls.shape[0] - -learning_rate = 0.0001 -momentum = 0.99 -batch_size = 32 diff --git a/config/simple_mlp_tgtcls_1_cswdtx.py b/config/simple_mlp_tgtcls_1_cswdtx.py deleted file mode 100644 index d51ddde..0000000 --- a/config/simple_mlp_tgtcls_1_cswdtx.py +++ /dev/null @@ -1,30 +0,0 @@ -import cPickle - -import data - -import model.simple_mlp_tgtcls as model - -n_begin_end_pts = 5 # how many points we consider at the beginning and end of the known trajectory -n_end_pts = 5 - -n_valid = 1000 - -with open(data.DATA_PATH + "/arrival-clusters.pkl") as f: tgtcls = cPickle.load(f) - -dim_embeddings = [ - ('origin_call', data.n_train_clients+1, 10), - ('origin_stand', data.n_stands+1, 10), - ('week_of_year', 52, 10), - ('day_of_week', 7, 10), - ('qhour_of_day', 24 * 4, 10), - ('day_type', 3, 10), - ('taxi_id', 448, 10), -] - -dim_input = n_begin_end_pts * 2 * 2 + sum(x for (_, _, x) in dim_embeddings) -dim_hidden = [500] -dim_output = tgtcls.shape[0] - -learning_rate = 0.0001 -momentum = 0.99 -batch_size = 32 diff --git a/config/time_simple_mlp_1.py b/config/time_simple_mlp_1.py new file mode 100644 index 0000000..eea4159 --- /dev/null +++ b/config/time_simple_mlp_1.py @@ -0,0 +1,19 @@ +import model.time_simple_mlp as model + +import data + +n_begin_end_pts = 5 # how many points we consider at the beginning and end of the known trajectory +n_end_pts = 5 + +n_valid = 1000 + +dim_embeddings = [ +] + +dim_input = n_begin_end_pts * 2 * 2 + sum(x for (_, _, x) in dim_embeddings) +dim_hidden = [200] +dim_output = 1 + +learning_rate = 0.00001 +momentum = 0.99 +batch_size = 32 diff --git a/config/time_simple_mlp_2_cswdtx.py b/config/time_simple_mlp_2_cswdtx.py new file mode 100644 index 0000000..ceb66e8 --- /dev/null +++ b/config/time_simple_mlp_2_cswdtx.py @@ -0,0 +1,26 @@ +import model.time_simple_mlp as model + +import data + +n_begin_end_pts = 5 # how many points we consider at the beginning and end of the known trajectory +n_end_pts = 5 + +n_valid = 1000 + +dim_embeddings = [ + ('origin_call', data.n_train_clients+1, 10), + ('origin_stand', data.n_stands+1, 10), + ('week_of_year', 52, 10), + ('day_of_week', 7, 10), + ('qhour_of_day', 24 * 4, 10), + ('day_type', 3, 10), + ('taxi_id', 448, 10), +] + +dim_input = n_begin_end_pts * 2 * 2 + sum(x for (_, _, x) in dim_embeddings) +dim_hidden = [500, 100] +dim_output = 1 + +learning_rate = 0.00001 +momentum = 0.99 +batch_size = 32 -- cgit v1.2.3