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.
Parameters
Section titled “Parameters”| Name | Type | Description | Optional |
|---|---|---|---|
dataset | RelationalDataset | TabularDataset | Dataset to run inference on. | No |
output_config | OutputConfig | Export destination. Use OutputConfig.snowflake() to write predictions to a Snowflake table. When None, predictions are not exported. | Yes |
output_alias | str | Override the auto-generated output table name. When None, the name is derived from the dataset and task names. | Yes |
overwrite_results | bool | If True, silently overwrite an existing Snowflake output table. If False (default), raise an error if the destination already exists. | Yes |
test_batch_size | int | Number 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_results | bool | If 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_table | str | File/table path for the test split. Optional — falls back to the task’s own test_table when not provided. | Yes |
Returns
Section titled “Returns”A JobMonitor to poll status and retrieve the export path.
Requirements
Section titled “Requirements”task.label_columnmust be set (seeICLEstimator).task.context_tablemust be set — ICL has no training loop, socontext_tablenames the labeled data used directly as the zero-shot context.- The task’s
test_table(or thetest_tableargument) must exist and contain the required entity/time columns. - If
ICLConfig.sampling_strategyis"most_recent"or"mixed", the task must have atime_columnset.
Examples
Section titled “Examples”Relational dataset
Section titled “Relational dataset”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.
Flat / forecasting dataset
Section titled “Flat / forecasting dataset”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",)Non-blocking job
Section titled “Non-blocking job”job = model.predict( relational_dataset, output_config=output_config, materialize_results=False,)
# Later, once the job has finished:job.materialize_results()Common Validation Errors
Section titled “Common Validation Errors”- “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_tablemust 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_columnon the task or usesampling_strategy="stratified"/"random". - “has no ‘test’ split” / “Inference requires ‘test_table’ to be set on the task” — set
test_table=on the task, or passtest_table=topredict(). - “Table ’…’ is missing required column(s): […]” — the context table or test table is missing a required column (label, time, or entity column).