The links
The links are the past events that tie a source to an item. There are two ways to give them.- An event table of the database. Give
link_table, the name of a table with a time column and a foreign key to each of the two tables. Anorderstable withcustomer_idandproduct_idis an example. - The links themselves. Give
links, a table with a source column, an item column and a time column.
Predict lists
The examples use a database sent as in Databases, and theAPI, HEADERS and records set up in the Quickstart.
links, and name their item column with dest_column and their time column with link_time_column.
How the lists are made
For each source at a date, the model draws on everything the database says about the source and the items: the source’s past links, what other sources picked, the other tables that relate the two, and the item columns, including their text. It ranks the items by how likely the link is. Only links and rows dated strictly before the date are read. When the model finds fewer suitable items thank, the list is filled with the items most picked in the window before. Those places are marked filled_from_popular and have no probability.
The lists for each date are made separately. The context for a date is made of the lists of the earlier dates, one window apart, whose outcome is already known.
Evaluate
/v1/databases/{database_id}/evaluate-recommend scores the lists of one date with MAP@k, the measure RelBench uses. By default the date is one window before the last link, so the outcome of every list is known.
without_text shows what the model gets from the item texts.
Files
format can be json, csv or parquet. A table has one row per item, with the columns id, rank, item, probability and filled_from_popular.