taxi

Winning entry to the Kaggle taxi competition
git clone https://esimon.eu/repos/taxi.git
Log | Files | Refs | README

time_mlp_tgtcls_2_cswdtx.py (940B)


      1 from blocks.initialization import IsotropicGaussian, Constant
      2 
      3 import data
      4 from model.time_mlp_tgtcls import Model, Stream
      5 
      6 
      7 n_begin_end_pts = 5     # how many points we consider at the beginning and end of the known trajectory
      8 
      9 # generate target classes as a Fibonacci sequence
     10 tgtcls = [1, 2]
     11 for i in range(22):
     12     tgtcls.append(tgtcls[-1] + tgtcls[-2])
     13 
     14 dim_embeddings = [
     15     ('origin_call', data.origin_call_size, 10),
     16     ('origin_stand', data.stands_size, 10),
     17     ('week_of_year', 52, 10),
     18     ('day_of_week', 7, 10),
     19     ('qhour_of_day', 24 * 4, 10),
     20     ('day_type', 3, 10),
     21     ('taxi_id', 448, 10),
     22 ]
     23 
     24 dim_input = n_begin_end_pts * 2 * 2 + sum(x for (_, _, x) in dim_embeddings)
     25 dim_hidden = [500, 100]
     26 dim_output = len(tgtcls)
     27 
     28 embed_weights_init = IsotropicGaussian(0.001)
     29 mlp_weights_init = IsotropicGaussian(0.01)
     30 mlp_biases_init = Constant(0.001)
     31 
     32 learning_rate = 0.0001
     33 momentum = 0.99
     34 batch_size = 32
     35 
     36 max_splits = 100