Skip to content

ICLEstimator.predict()

Submits an ICL inference job and returns a JobMonitor. Runs DFS (for RelationalDataset) or the flat pipeline (for TabularDataset), then ICL, on the task’s test split.

NameTypeDescriptionOptional
datasetRelationalDataset | TabularDatasetDataset to run inference on.No
output_configOutputConfigExport destination. Use OutputConfig.snowflake() to write predictions to a Snowflake table. When None, predictions are not exported.Yes
output_aliasstrOverride the auto-generated output table name. When None, the name is derived from the dataset and task names.Yes
overwrite_resultsboolIf True, silently overwrite an existing Snowflake output table. If False (default), raise an error if the destination already exists.Yes
test_batch_sizeintNumber of rows per inference chunk. Larger values are faster but use more memory — the kv_cache used internally is memory-heavy, so this defaults to a conservative 256. Increase only if you know the target memory budget can absorb it.Yes
materialize_resultsboolIf True, block until the job completes and predictions are written to the export destination before returning. Requires output_config to be set. Defaults to True.Yes
test_tablestrFile/table path for the test split. Optional — falls back to the task’s own test_table when not provided.Yes

A JobMonitor to poll status and retrieve the export path.

  • task.label_column must be set (see ICLEstimator).
  • task.context_table must be set — ICL has no training loop, so context_table names the labeled data used directly as the zero-shot context.
  • The task’s test_table (or the test_table argument) must exist and contain the required entity/time columns.
  • If ICLConfig.sampling_strategy is "most_recent" or "mixed", the task must have a time_column set.
from relationalai_predictive import ICLEstimator, ICLConfig, OutputConfig
model = ICLEstimator(connector=connector, config=ICLConfig(n_estimators=8))
output_config = OutputConfig.snowflake(
database_name="DATABASE_NAME",
schema_name="PUBLIC",
)
job = model.predict(
relational_dataset,
output_config=output_config,
output_alias="EXPERIMENT_1",
)

By default, predictions are written to a table named PREDICTIONS_{output_alias} in the schema defined in the OutputConfig.

from relationalai_predictive import (
ICLEstimator, ICLConfig, TabularTask, TabularDataset, TaskType, OutputConfig,
)
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",
prediction_length=12,
max_context_length=64,
)
dataset = TabularDataset(connector=connector, name="sales", task=task)
model = ICLEstimator(connector=connector, config=ICLConfig(device="cpu"))
job = model.predict(
dataset,
output_config=OutputConfig.snowflake(database_name="DATABASE", schema_name="SCHEMA"),
output_alias="SALES_FORECAST_1",
)
job = model.predict(
relational_dataset,
output_config=output_config,
materialize_results=False,
)
# Later, once the job has finished:
job.materialize_results()
  • “ICLEstimator requires task.label_column to be set” — ICL has no training loop; the context table must carry labels.
  • “ICL requires context_table to be set on the task”context_table must be set explicitly.
  • “ICLEstimator does not support task_type=… for RelationalDataset/TabularDataset” — see the supported task types table in ICLEstimator.
  • “sampling_strategy=‘most_recent’/‘mixed’ requires a time_column on the task, but none is set” — either set time_column on the task or use sampling_strategy="stratified"/"random".
  • “has no ‘test’ split” / “Inference requires ‘test_table’ to be set on the task” — set test_table= on the task, or pass test_table= to predict().
  • “Table ’…’ is missing required column(s): […]” — the context table or test table is missing a required column (label, time, or entity column).