Join on when a value went online, not on the data it covers
A feature value has two times, and the join must use the right one.
| Row | Value | Event time (data through) | Created time (online from) |
|---|---|---|---|
| A | 0.31 | Mar 1, 00:00 | Mar 1, 04:10 |
| B | 0.35 | Mar 2, 00:00 | Mar 2, 04:10 |
| C | 0.52 | Mar 3, 00:00 | Mar 3, 04:10 |
This is the trap most designs walk into. Here's one member's genre-affinity feature, three daily rows. Each row carries two times. Its event time says what data it covers. Its created time says when it reached the online store.
From midnight to 04:10, a join on event time hands training row B. Serving didn't have row B yet. It was still reading row A.
Build a training set on March 3 at noon, and join three impressions four ways:
| Impression | Latest value | As-of on event time | As-of on created time | What serving read |
|---|---|---|---|---|
| Mar 2, 02:00 | 0.52 | 0.35 (B) | 0.31 (A) | 0.31 |
| Mar 2, 20:00 | 0.52 | 0.35 (B) | 0.35 (B) | 0.35 |
| Mar 3, 09:00 | 0.52 | 0.52 (C) | 0.52 (C) | 0.52 |
Taking the latest value leaks into the first two rows. The event-time join is right most of the day, and wrong between midnight and 04:10. If traffic were spread evenly over the day, that's every row in the first 4 hours 10 minutes of 24. Each of them is a day fresher in training than it was in serving. Only the created-time join matches serving on all three.
Feast's docs flag this: "By default, point-in-time joins only constrain the feature's event timestamp." So a value that was backfilled or corrected after a label's time can still be returned for it.
An option, filter_by_created_timestamp=True, adds the created-time condition. The docs say it helps keep backfilled values out of training data, and helps reproduce what the online store would have served. The option's name isn't the point. Any join can add the same condition, as the SQL in the next step does.
Streaming features hit the same problem in another form. A stream running 30 seconds behind serves values 30 seconds old. A backfill computed from the event log at exact timestamps has no lag at all. If the lag matters for a feature, train on the stream's own logged output, or shift the backfill by the lag you measured.
In the editor, write too_fresh(minute, lands) and share(minutes, lands). LANDS is 04:10 as a minute of the day, and the last line checks one impression in every minute of a day.