Skip to main content

Task types

The validator infers a task type from the target's shape. The task type selects the model checkpoint and the output form — you never declare it.

Target shapeTask typeOutput
bare aggregation — SUM(...), COUNT(...)regressionvalue
aggregation vs literal — COUNT(...) = 0binary classificationprobability
FIRST / LAST / static categorical columnmulticlass classificationclass + probabilities
LIST_DISTINCT(...) RANK TOP Krankingranked ID list
any target with FORECAST N TIMEFRAMESforecastingvalue per timeframe

Model routing

ModelConfig maps task types to checkpoints — by default the classification family routes to hf://stanford-star/rt-j/classification and regression/forecasting to hf://stanford-star/rt-j/regression.

Checking a query

Every library exposes the inference without executing:

pq = relativedb.parse("PREDICT SUM(orders.qty, 0, 30) FOR EACH customers.customer_id")
pq.task_type() # TaskType.REGRESSION