Skip to content

TabularTask

Describes a flat, single-table prediction task for ICLEstimator — no relational schema, no foreign/candidate keys, no DFS. TabularTask supports every task type ICL supports on a flat table, including forecasting, which has no equivalent on the relational (NodeTask) path.

Used together with TabularDataset, which simply wraps a connector and a TabularTask.

ParameterTypeDescriptionOptional
namestrHuman-readable task name.No
task_typeTaskTypeOne of TaskType.BINARY_CLASSIFICATION, MULTICLASS_CLASSIFICATION, REGRESSION, or FORECASTING.No
label_columnstrColumn holding the target labels or values.No
train_tablestrPath to the training split. Optional — recorded for reference only. ICLEstimator never uses it as context; there is no training loop, so it has no other purpose here.Yes
validation_tablestrPath to the validation split, required by score() (or pass val_table= at call time).Yes
test_tablestrPath to the test split, required by predict() (or pass test_table= at call time).Yes
context_tablestrTable used as the zero-shot ICL context. Required for predict()/score() — must be set explicitly.Yes (required at call time)
time_columnstrDatetime column. Required when task_type=FORECASTING; also used by the "most_recent"/"mixed" sampling strategies for classification/regression.Yes / required for forecasting
item_id_columnstrSeries partition key for panel forecasting (multiple entities, one series each). Omit (None) for single-entity forecasting.Yes
prediction_lengthintSteps ahead to forecast. Required when task_type=FORECASTING; must be >= 1.Required for forecasting
max_context_lengthintMax history length (in time steps) the forecaster looks back over. Required when task_type=FORECASTING; must be >= 1.Required for forecasting
evaluation_metricEvaluationMetricMetric to compute in score(). Auto-selected when None. Must be a valid metric for task_type.Yes
column_dtypesDict[str, str]Optional dtype overrides applied before featurization.Yes

An instance of the TabularTask class.

from relationalai_predictive import TabularTask, TaskType
task = TabularTask(
name="churn",
task_type=TaskType.BINARY_CLASSIFICATION,
label_column="churned",
context_table="DATABASE.SCHEMA.CHURN_CONTEXT",
test_table="DATABASE.SCHEMA.CHURN_TEST",
validation_table="DATABASE.SCHEMA.CHURN_VALIDATION",
)
from relationalai_predictive import TabularTask, TaskType
task = TabularTask(
name="sales_forecast",
task_type=TaskType.FORECASTING,
label_column="sales",
context_table="DATABASE.SCHEMA.SALES_CONTEXT",
test_table="DATABASE.SCHEMA.SALES_TEST",
time_column="date",
item_id_column="store_id",
prediction_length=12,
max_context_length=64,
)