Skip to content
Docs
Join the API waitlist

Context, query and target

One table supplies known answers. A second table asks new questions with the same feature columns.
On this page

Give the model examples

The table that carries the answers is called the context, and the table you want predictions for is called the query. Both contain the same feature columns, with the same names in the same order, and only the context contains the target column. Because the model reads the columns by position, a query whose columns are in a different order is refused with a 422 response that lists both orders.

There are two models. causilo-clf handles classification and causilo-reg handles regression, both on the Causilo 1.5 weights. causilo-clf-1.0 and causilo-reg-1.0 answer from the Causilo 1.0 weights, for a caller who needs the answers 1.0 gave; they start on demand, so the first call after an idle spell is answered 503 with a Retry-After of a few minutes. If you want to see how they compare with gradient-boosted trees, the Causilo vs XGBoost example runs XGBoost and LightGBM at their default settings on the same table.

Context: known target

regionspendrenewed · target
EU120yes
US340yes
EU0no

Query: features only

regionspend
EU200
US50

Context conditions this query through Causilo.

Result shape

Causilo → one label per query row

Query orderrenewed · prediction
1 · EU, 200returned label
2 · US, 50returned label

Placeholders show the response shape; they are not recorded prediction values.

Illustrative input and result shape from Quickstart. The query omits the target and keeps feature names and order. Returned labels follow query order.

Check the data conditions

What a column may hold

Each kind of column is handled as follows. Every refusal is a 422 response whose detail names the column.

Context, query and target: table 4
In your tableWhat happens
Missing values in a featureAccepted as they are. The model handles missing values natively, so there is no need to impute them first.
StringsAccepted and treated as categories, with no encoding needed on your side.
Columns on very different scalesAccepted. No scaling or normalisation is needed.
A query column that is empty on every rowRefused, because the prediction would otherwise ignore that column without saying so.
Dates, times, durationsRefused. Split them into numeric parts such as year, month and day of week, or send epoch seconds. Preprocessing would drop the whole column, and the predictions would ignore it without any warning.
Decimal columnsRefused. A Postgres or BigQuery NUMERIC column becomes this type in pandas, so cast it to float first.
Lists, dicts, structsRefused.
Infinities, or values at or above about 2.45e151, the ceiling at the 300,000-row limitRefused. Rescale the column or drop those rows.
float16Widened to float32 for you.
Duplicate column namesRefused.
Your DataFrame indexDropped and never sent, so put anything you need to keep in a column.

The same column must hold the same kind of value in both tables. A context in which every feature column holds a single value is refused, since there is nothing in it to predict from.

What the target column may hold

The target column is present in the context and absent from the query. In a single Parquet file, the rows with an empty target are the rows to predict.

Context, query and target: table 5
RuleApplies to
No missing values in the context's targetboth models
Not Decimal, bytes, lists or dictsboth models. Cast a Decimal target to float, or to text if the digits are a label; decode bytes to text.
At most 64 distinct values, and at least twocausilo-clf
Whole numbers or strings, not fractionscausilo-clf
Numeric labels must be below 9.223e18, the largest 64-bit integer; a label at or above it is refusedcausilo-clf. Send larger identifiers as strings.
Numeric, finite, under 3.4e38causilo-reg
Not a datetimecausilo-reg, whose predictions would otherwise come back as epoch integers with no unit. causilo-clf treats each distinct date as a class and returns it as a string.