aboutsummaryrefslogtreecommitdiff
path: root/transformers.py
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-05-05 14:15:21 -0400
committerAlex Auvolat <alex.auvolat@ens.fr>2015-05-05 14:15:21 -0400
commit54613c1f9cf510ca7a71d6619418f2247515aec6 (patch)
treebed9a5a11ef5b7feecee44095a29400e32f76b05 /transformers.py
parent712035b88be1816d3fbd58ce69ae6464767c780e (diff)
downloadtaxi-54613c1f9cf510ca7a71d6619418f2247515aec6.tar.gz
taxi-54613c1f9cf510ca7a71d6619418f2247515aec6.zip
Add models for time predictioAdd models for time prediction
Diffstat (limited to 'transformers.py')
-rw-r--r--transformers.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/transformers.py b/transformers.py
index 6ee0df1..73e3868 100644
--- a/transformers.py
+++ b/transformers.py
@@ -32,7 +32,7 @@ class Select(Transformer):
class TaxiGenerateSplits(Transformer):
def __init__(self, data_stream, max_splits=-1):
super(TaxiGenerateSplits, self).__init__(data_stream)
- self.sources = data_stream.sources + ('destination_latitude', 'destination_longitude')
+ self.sources = data_stream.sources + ('destination_latitude', 'destination_longitude', 'time')
self.max_splits = max_splits
self.data = None
self.splits = []
@@ -63,7 +63,7 @@ class TaxiGenerateSplits(Transformer):
dlat = numpy.float32(self.data[self.id_latitude][-1])
dlon = numpy.float32(self.data[self.id_longitude][-1])
- return tuple(r + [dlat, dlon])
+ return tuple(r + [dlat, dlon, 15 * (len(self.data[self.id_longitude]) - 1)])
class TaxiAddFirstK(Transformer):
def __init__(self, k, stream):