Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.What did you know, and when?
Suppose you want to learn to predict tomorrow’s weather from today’s sky. If, while practising, you accidentally peek at photos taken tomorrow morning, you will seem brilliant during practice and fail on the real day. Machine-learning features can peek in the same way when they are joined to past examples carelessly. A feature store keeps a careful diary of what every feature’s value was at every moment, so training sees only what was knowable then, and serving sees the same thing, kept up to date.
Online store refreshed every 6 h: serving AUC 0.8570, precision among the 200 most urgent alerts 0.470, 4 feature writes per pump per day.
N1-3, seed 0: 200 pumps, predicting failure within 24 hours. Joining features computed at the end of the day leaks the future: it looks best offline and ranks alerts badly in service. Stale online features hide the newest vibration; refreshing on change spends writes where they matter.
In Exercise 2, features joined at the end of each day looked better offline (AUC 0.9145 against 0.8701) but only 38% of the 200 most urgent alerts were real failures in service, against 83% with point-in-time features.
- 1. A feature store serves features for…
- 2. Using information from after the prediction time in training is called…
- 3. An online store mainly provides…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.By hand
- Offline store: the history of feature values with timestamps, used to build training sets and backfills (in a warehouse or lake).
- Online store: the latest feature value per entity, read at serving time with millisecond latency (in a key-value store).
- Materialization: computing feature values and writing them to the stores, on a schedule or from a stream.
- Point-in-time (as-of) join: for each training example (entity, time), the latest feature value at or before that time.
- Freshness and staleness: how old the served feature value is; set by ingestion delays and the refresh schedule.
- Training-serving consistency: features defined once and computed the same way for both paths.
- Backfill: computing a new feature’s past values from raw data so it can be used for training at once.
- Systems: Uber’s Michelangelo, Feast, Tecton, Hopsworks, and the feature stores of the cloud ML platforms.
- 1. A point-in-time join takes the feature value…
- 2. The online store typically lives in…
- 3. A backfill…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.Point-in-time features for predictive maintenance
Exercise 1.
- 200 pumps reporting vibration every hour for 120 days; vibration rises over the 48 hours before most failures, alerts fire when it is high, and failed pumps are repaired within hours.
- Features at any hour from cumulative sums: mean vibration over 24 hours, its change from the previous 24, alerts over 7 days, log hours since maintenance.
- Labels: failure within the next 24 hours; logistic regression; AUC and precision among the 200 highest scores.
Practice.
- Define features once and generate both training and serving values from that definition.
- Join by availability time, the time a value was known to the system, not only the time it describes.
- Version feature definitions and keep their history so any training set can be rebuilt.
- Match freshness to the problem: features that change fast need streaming or event-triggered updates.
- Log served feature values and compare them with the offline computation.
- Evaluate offline the way the model will be served, including staleness.
def asof_join(keys, times, rows): # rows: per key, (time, value) sorted
out = []
for k, t in zip(keys, times):
ts, vs = rows[k]
i = searchsorted(ts, t, side='right') - 1 # last row at or before t
out.append(vs[i] if i >= 0 else nan)
return out- 1. Training and serving features should come from…
- 2. Data that arrives three hours late should be joined by…
- 3. Served feature values should be…
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.Theory
Leakage. Let a training example at time t use a feature computed from data up to s. If s is after t, the feature contains information that will not exist at serving time; a model can exploit it and look better offline while learning a relation that breaks in service. Here vibration in the hours after t rises sharply for pumps that fail soon after t, so a join to end-of-day values hands the model part of the answer, and the pumps that fail in the evening look obvious in the morning.
Staleness. With refresh every R hours, a query at hour t reads values computed at R⌊t/R⌋, so the staleness t − R⌊t/R⌋ is uniform on 0, …, R − 1 for queries spread over time, with mean (R − 1)/2. Staleness removes the newest information, and when the signal is in recent change (as for a pump about to fail), a model trained on equally stale features recovers little of it.
Evaluation of ranking. The area under the ROC curve is the probability that a random positive scores above a random negative; it equals (R₊ − n₊(n₊ + 1)/2)/(n₊n₋), where R₊ is the sum of the positives’ ranks. For alerting, precision among the top k matters more: an engineer inspects only the most urgent pumps, so a model can keep its AUC while its top alerts degrade.
- 1. Mean staleness with refresh every R hours (integer hours) is…
- 2. AUC is the probability that…
- 3. Leaky features make offline metrics…
Level 4: Expert
★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.How much do a leaky offline join and a stale online store change what a failure predictor achieves in service?
History.
- S. Kaufman, S. Rosset and C. Perlich (2012) catalogued leakage in data mining competitions and applications.
- Uber described Michelangelo in 2017, with a shared feature store for training and serving; Airbnb (Zipline), Gojek and Google (Feast, 2019), Hopsworks and Tecton followed.
- D. Sculley and colleagues (2015) listed training-serving skew among the hidden technical debts of ML systems; cloud ML platforms now include feature stores.
Exercise 2.
- Training rows every 7 hours from day 7 to day 80 (50,200 rows); serving rows every 5 hours from day 82 to day 119.
- Three ways to join training features: point in time (as of t), end of day (as of the last hour of t’s day), latest snapshot (as of the end of the training period). Serving always uses features as of t, or as of the last refresh of the online store.
Seed 0:
| training join | offline AUC | serving AUC | serving precision at 200 |
|---|---|---|---|
| point in time | 0.8701 | 0.8674 | 0.830 |
| end of day | 0.9145 | 0.8674 | 0.380 |
| latest snapshot | 0.5393 | 0.7787 | 0.335 |
| refresh every | serving AUC | precision at 200 | trained with matching staleness | writes per pump per day |
|---|---|---|---|---|
| 1 h | 0.8674 | 0.830 | 0.830 | 24 |
| 6 h | 0.8570 | 0.470 | 0.485 | 4 |
| 24 h | 0.7897 | 0.215 | 0.235 | 1 |
| 72 h | 0.6200 | 0.095 | 0.090 | 0.33 |
Seeds 1 and 2: end of day offline AUC 0.9135 and 0.9113 against 0.8786 and 0.8818 point in time, serving precision 0.425 and 0.375 against 0.870 and 0.870; with 6-hour refresh, precision 0.545 and 0.500; with 24-hour refresh, 0.195 and 0.175.
Findings.
- The end-of-day join raised offline AUC by 3 to 4.5 points and cut serving precision at 200 from 0.83 to 0.87 down to 0.38 to 0.43, in every seed, while serving AUC barely changed.
- A 6-hour refresh cut precision at 200 by 32 to 37 points, mostly because pumps that had just failed still looked about to fail; training with equally stale features won back 1.5 to 10.5 points, under a third of the loss.
- The latest-snapshot join was useless offline (AUC 0.54 to 0.55).
Feature stores in practice
- Fraud, recommendations and pricing rely on features that change within minutes, served from online stores fed by streams (topic N1-1).
- Feature platforms (Feast, Tecton, Hopsworks, Databricks, Vertex AI and SageMaker feature stores) provide point-in-time joins, materialization and monitoring.
- Predictive maintenance in industry and space joins telemetry with maintenance and failure logs; ingestion delays from ground contacts make availability time essential.
References
- S. Kaufman, S. Rosset and C. Perlich (2012). “Leakage in data mining: formulation, detection, and avoidance.” KDD (journal version TKDD 2012).
- J. Hermann and M. Del Balso (2017). “Meet Michelangelo: Uber’s machine learning platform.” Uber Engineering.
- D. Sculley and colleagues (2015). “Hidden technical debt in machine learning systems.” NeurIPS.
- Feast (2019–). “Feast: an open source feature store for machine learning.” feast.dev.
- T. Fawcett (2006). “An introduction to ROC analysis.” Pattern Recognition Letters.