18/35
Part 2 of 3 · Two stores, one truthLearn and do
Log what you served, or recompute it later
There are three ways to build training rows, and they differ in what they risk.
Three ways to build training rows
| Recompute from the warehouse | Log the served features | Log the facts, regenerate | |
|---|---|---|---|
| Try a new feature on past weeks | right away | only from the day it ships | right away, over facts already logged |
| Code skew | possible: a second implementation | none | none: the encoders are shared |
| Time skew | possible: wrong timestamps, late events, missing defaults | none | none: the facts are what serving fetched |
| The catch | skew, unless every join is right | weeks of waiting, and log volume | storing the facts, and no fact you never logged |
The three differ in how fast you can try a new feature, and in how much skew they let in.
Recomputing from the warehouse is the fastest to try. Run the feature definitions over historical tables with point-in-time joins. You can try a new feature over a year of history this afternoon.
The risk is every way a mismatch slips in:
- a second implementation
- a join on the wrong timestamp
- late events that the warehouse has and the stream never saw
- the timeouts and defaults that happened online and never show up offline.
In the editor, write history_days(route, shipped_days_ago, facts_days, warehouse_days, new_fact). It puts the table's first row in numbers: how many past days a new feature can train on under each route.