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
EXISTS(...) / NOT EXISTS(...) (boolean target)binary classificationprobability
FIRST / LAST / static categorical columnmulticlass classificationclass + probabilities
LIST_DISTINCT(...) RANK TOP Krankingranked ID list
any target whose window has HORIZONS > 1forecastingvalue per horizon

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.

The output column above is the logical form each task produces. The built-in history baseline produces all of them; the native RT-J backend currently serves binary-classification and regression heads, so multiclass and ranking targets fall back to the baseline (see Model backends).

Checking a query

Every library exposes the inference without executing:

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