23/36
Part 3 of 5 · Ranking and featuresLearn and do
Group features by how fresh they must be
The ranker's features don't all change at the same speed, and that decides where each one is computed.
Freshness decides where a feature is computed
| Source | Holds | Reaches the ranker |
|---|---|---|
| daily batch job, into a feature store | listing, guest, engagement | per request |
| stream of clicks, into a session store | clicked, skipped, seconds old | per request |
| the request itself | query, price for these dates, cross features | per request |
Group features by family and by how fresh they need to be. The freshness column decides where each one is computed and stored.
| Family | Examples | Freshness | Watch out for |
|---|---|---|---|
| Listing | Price for these dates, location, capacity, amenities, rating, photo quality | Daily, price per request | Price depends on the dates searched |
| Listing engagement | Past bookings, views, conversion rate, host acceptance | Daily | Missing for new listings |
| Guest | Past bookings, typical price, party size, device | Daily | Missing for logged-out guests |
| Query | Location, check-in, nights, lead time, guests, filters, map zoom | Per request | No text, so this is all the intent you get |
| Session | Listings clicked and skipped, similarity to them | Seconds | The freshest signal you have |
| Cross | Price against this guest's usual price, distance to the map center | Per request | Computed at scoring time |
In the editor, write cross_features(listing, guest, query): the two features in the table's Cross row, price_ratio and km_to_center. A listing holds its price per night by date and its map position in km, a guest holds a usual price or is None when logged out, and a query holds its nights and the map's center.