Filters and Operators
Predictive Query Language (PQL), Kumo Relational’s SQL-like query language, controls which entities receive predictions and which historical records the model uses as context. An entity is the table key that identifies a record to score, such as a customer ID. Use the controls on this page to target specific entities, limit the history available to the model, reproduce a prediction at a past point in time, or evaluate a hypothetical attribute value.
FORand theindicesparameter select the entities to score.WHEREfilters historical context without changing which entities receive predictions.anchor_timeandcontext_anchor_timeset the reference times for prediction and context windows.ASSUMINGconditions a prediction on a hypothetical attribute value without establishing that the value causes the outcome.
Select entities
Specify an explicit ID or list of IDs directly in the query:
For a programmatically generated list, pass the IDs through the indices parameter of predict() instead of rewriting the query.
The example assumes that graph contains a configured Kumo Relational graph.
The indices parameter overrides IDs embedded in the query. A single inference call accepts at most 1,000 IDs.
Filter historical context
Temporal WHERE filters restrict the prior events used as context without changing the entity list:
The WHERE clause retains historical context with at least one order during the 30 days before the anchor time.
Kumo Relational currently supports static column filters only when the filter stays within one table. The broader PQL grammar can describe joined static filters, but the Kumo Relational validator does not currently accept them.
Combine conditions
Use AND, OR, and NOT to combine type-compatible conditions:
Start with one condition, and add other conditions only after the base query succeeds.
Set the anchor time
The anchor time defines “now” for temporal windows, including when a prediction horizon begins.
Pass time controls directly to predict():
An explicit historical anchor time lets you backtest predictions as if they were made at that point in time. Ensure that features and labels respect the time boundary so future information does not leak into the prediction.
Use "entity" when each row in the entity table has its own reference timestamp:
Here, model is the graph-bound handle returned by client.relational(graph).
You can specify separate anchors for prediction and context.
anchor_time sets the reference point for the prediction window, while context_anchor_time sets the reference point for the historical context:
Verify that the deployed SDK and NIM versions support the optional inference controls.
Condition with ASSUMING
Use ASSUMING to evaluate a prediction under a hypothetical attribute value:
Kumo Relational conditions the prediction on in-context examples that have the specified value. This operation does not estimate a causal treatment effect, so the result is not proof that changing the attribute will cause the predicted outcome.
Use an assumed state only when it has adequate historical representation. Check the stability of the results across related cohorts, protect sensitive attributes, and do not use an assumed association as the sole basis for a high-stakes decision.