Skip to main content
For a database prediction you normally provide labelled examples: an entity, a date and the known answer. Building them is often the slowest part of a project. You have to pick the dates, compute each answer from the event tables, and make sure no answer reads past its window. For many common questions you can skip this step. You describe the answer, and tabSutra builds the examples for you.

Three kinds of task

The examples use a database sent as in Databases, and the API, HEADERS and records set up in the Quickstart.

next_days

This asks for the total order amount of each customer in the 30 days after 1 June 2026. The fields are: The measures are: A mean, a maximum and a share need at least one event in the window. With rows set to all, an entity with no event in an example’s window gets no example for that date.

How the examples are built

You give the date to stand at with at. By default it is the database’s last date. tabSutra then:
  1. picks 12 dates, one window apart, the latest one window before at, so that every answer is known by at;
  2. leaves out dates that have less than two windows (or a tenth of the database’s span) of history before them;
  3. computes the answer of every entity at each date from the events in the window after it;
  4. predicts the answer at at for the entities chosen by rows.
Change the number of dates with n_dates. Nothing dated after at is read, so you can stand at a past date and compare the predictions with what happened. The report lists the dates of the examples and the number of examples made.

next_items

By default the sources are those with a link in the window before at. To choose them yourself, add "rows": [list of source keys]. The answer is a recommendation, as described in Recommendation.

fill_column

This predicts the empty values of segment from the rows of customers that have one. It reads it as a table, including its text columns. Send these bodies to /v1/databases/{database_id}/tasks/predict.

Evaluate a task

/v1/databases/{database_id}/tasks/evaluate builds the examples in the same way and holds out the latest dates.
For next_items it gives MAP@k, and for fill_column it gives the scores of a table.