Zipline is Airbnb’s data management platform specifically designed for ML use cases. Previously, ML practitioners at Airbnb spent roughly 60% of their time on collecting and writing transformations for machine learning tasks.
12. An example
● Predict likelihood of you liking a particular Indian restaurant
● Total visits to Indian places last month
● Average rating of the restaurant last year
● They are all aggregations
13. An example
● Predict likelihood of you liking a particular Indian restaurant
● Total visits to Indian places last month
● Operation: Count, Input: Visit, Window = 1month,
● Source: Check-in stream
● Average rating of the restaurant
● Operation: AVG, Input: rating, Window = 1yr
● Source: Ratings table
● They are all aggregations
25. Aggregations – SUM
• Commutative: a + b = b + a
• Associative: (a + b) + c = a + (b + c)
• Reversible: (a + b) – a = b
• Abelian Group
26. Aggregations – AVG
• One not-so-clever trick
• Operate on “Intermediate Representation” / IR
• Factors into (sum, count)
• Finalized by a division: (sum/count)
27. Aggregations
• Constant memory / Bounded IR
• Two classes of aggregations
• Sum, Avg, Count etc.,
• Reversible / Abelian Groups
• Min, Max, Approx Unique, most sketches etc.,
• Non-Reversible / Commutative Monoids / Non-Groups
28. Incremental Windowing – with reversibility
0 1 .. .. 0 1 0 ..
Visits – check-in stream of a user
1 4 6 8 9 8 7
In the last year
-1 +0
30. Windowing – w/o reversibility
• Time: O(N^2) vs O(NLogN)
• Space: N vs 2N memory
Groups Non-Groups
Un-Windowed No-Reversal No-Reversal
Windowed Reversal Tree
31. Windowing – w/o reversibility
• Tiling problem
• Tile([left, right]) => Tile([left, split_point]) + Tile([split_point, right])
• Split_point => right && (MAX_INT << msb(left ^ right))
• Tiles are the binary representation of (right – split_point) and (split_point - left)
• Less hand-waving in the paper
32. Reversibility - Unpacking Change data
• Deletion is a reversal
• Update is a delete followed by an insert
• Example:
• Sudden heat wave forecast at 7 pm.
33. user Time
123 2019-09-13 17:31
234 2019-09-14 17:40
345 2019-09-15 17:02
Example
Visits
Sum / month
Rating
Max / year
5 4
20 4
6 2
Query Log Aggregated Features
34. Feature Backfill
• Time-series join with aggregations
• Left :: Query Log :: [(Entity Key, timestamp)]
• Right :: Raw Data :: [(Entity Key, timestamp, unaggregated)]
• Output :: Feature Data :: [(Entity Key, timestamp, aggregated)]
• Aggregation and join is fused
• Raw data >> query log