Filters and Operators
In Kumo Relational, PQL separates the entities to score from the historical context used to form a prediction. The following clauses and parameters each have a distinct role:
FORand theindicesparameter select the entities for which to generate predictions.WHEREfilters the historical context.ASSUMINGconditions the prediction on a hypothetical attribute value.
Select Entities
Specify an explicit key or list of keys in the query:
For a programmatically generated list, pass the keys through materialize(indices=...):
The indices parameter overrides keys embedded in the query. A materialize() call accepts up to 100,000 keys, gathered as up to 100 NIM calls.
Filter Which Context Examples Qualify
A temporal WHERE clause selects which entity/anchor rows become labeled context examples. It does not remove individual historical events from the related tables, and it does not narrow explicitly scored indices:
The WHERE clause retains as context examples the entities that had at least one order during the 30 days before the anchor time.
Current Kumo Relational static column filters are limited to columns in the same table. The current validator does not support joined static filters described by broader PQL grammars. The following example applies a static filter on a column in the same table:
Combine Conditions
Use AND, OR, and NOT with type-compatible expressions:
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. Pass time controls to materialize():
An explicit historical anchor time is useful for backtesting. Ensure that both features and labels comply with the time boundary.
You can specify separate anchors for prediction and context:
Verify that the deployed SDK and NIM versions support the optional inference controls.
sdm-client automatically drops from the context any row that is a scored row itself, at the moment it answers the question being asked. A warning names how many rows were removed. You do not need to hand-craft WHERE and anchor-time logic solely to prevent that specific leak.
Condition With ASSUMING
The following example conditions the prediction on an assumed attribute value:
The ASSUMING clause conditions the prediction on in-context examples that have the specified value. It does not estimate a causal treatment effect, and you must not interpret it as proof that changing the attribute causes 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.
Related Topics
For more information, refer to the following pages: