From ccc92aaa1eb24fdf00afb254f56982b1bac406d1 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 14 Jul 2015 12:59:30 -0400 Subject: Update transformers --- data/transformers.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/data/transformers.py b/data/transformers.py index 6d3f488..c2eb97e 100644 --- a/data/transformers.py +++ b/data/transformers.py @@ -24,6 +24,8 @@ def at_least_k(k, v, pad_at_begin, is_longitude): class Select(Transformer): + produces_examples = True + def __init__(self, data_stream, sources): super(Select, self).__init__(data_stream) self.ids = [data_stream.sources.index(source) for source in sources] @@ -36,6 +38,8 @@ class Select(Transformer): return [data[id] for id in self.ids] class TaxiExcludeTrips(Transformer): + produces_examples = True + def __init__(self, stream, exclude_list): super(TaxiExcludeTrips, self).__init__(stream) self.id_trip_id = stream.sources.index('trip_id') @@ -48,6 +52,8 @@ class TaxiExcludeTrips(Transformer): return data class TaxiExcludeEmptyTrips(Transformer): + produces_examples = True + def __init__(self, stream): super(TaxiExcludeEmptyTrips, self).__init__(stream) self.latitude = stream.sources.index('latitude') @@ -59,8 +65,11 @@ class TaxiExcludeEmptyTrips(Transformer): return data class TaxiGenerateSplits(Transformer): + produces_examples = True + def __init__(self, data_stream, max_splits=-1): super(TaxiGenerateSplits, self).__init__(data_stream) + self.sources = data_stream.sources + ('destination_latitude', 'destination_longitude', 'travel_time') self.max_splits = max_splits self.data = None -- cgit v1.2.3