Skip to main content
POST
Predict an answer per entity and date, from labelled examples

Authorizations

Authorization
string
header
required

Your API key, sent as 'Authorization: Bearer '.

Path Parameters

database_id
string
required

Body

application/json
entity_table
string
required

The table whose rows get an answer (customers, drivers, posts).

Example:

"customers"

entity_column
string
required

The column of the examples and of the rows to predict that holds the entity table's primary key.

Example:

"customer_id"

time_column
string
required

The column of the examples and of the rows to predict that holds the date.

Example:

"date"

target
string
required

The column of the examples that holds the answer.

Example:

"spend_next_30_days"

task
enum<string>
required

'classification' (a category: will the customer buy) or 'regression' (a number: how much).

Available options:
classification,
regression
window_days
number
required

The answer is about the window_days days after the date; an example's answer is known that long after its date.

Example:

30

examples
Examples · object[]
required

Labelled examples: entity, date, answer. Only those dated before the first row to predict are used, and a row reads those whose answer was known before that.

rows
Rows · object[]
required

The rows to predict: entity and date.

outputs
string[] | null

classification: label, probabilities. regression: mean, median, quantiles, interval. Default: all of them.

quantiles
number[]

Regression: the levels (between 0 and 1) of the quantiles returned.

coverage
number
default:0.8

Regression: the share of the predicted distribution the interval holds.

exclude_columns
string[]

'table.column' entries the model must not read (a column that holds the answer itself).

Example:
id_column
string | null

A column of the rows that keys the predictions (default: the row's position).

target_range
Target Range · object | null

Regression: outputs are clipped to [low, high].

explain
boolean
default:false

Add to each prediction the contribution of each input to it. See Explanations.

explain_top
integer
default:10

The number of largest contributions returned per prediction.

Required range: 1 <= x <= 100
explain_class
string | null

Classification: the class whose probability is explained. Default: the predicted label.

Response

Successful Response

predictions
Predictions · object[]
required

One object per row, keyed by 'id' (the id column, or the row's position).

report
Report · object
required