predict

TabularFoundationModel.predict(test_data: str | Path | DataFrame, train_data: str | Path | DataFrame, label: str, *, predictions_path: str | None = None, hyperparameters: Dict[str, Any] | None = None, instance_type: str | None = None, framework_version: str = 'latest', custom_image_uri: str | None = None, wait: bool = True, **backend_kwargs) → Series | JobPredictionFuture[source]

Run batch prediction for tabular tasks.

For tabular foundation models (e.g., Mitra), train_data provides the few-shot context and test_data contains the rows to predict on.

Parameters:
  • test_data – Data to predict on. Must contain every feature column present in train_data except label.

  • train_data – Labeled few-shot context for the foundation model, as a DataFrame or local/S3 path to a data file.

  • label – Target column name in train_data.

  • predictions_path – S3 URL where predictions will be written by the training container (e.g. s3://my-bucket/runs/2024-05-01/predictions.csv). Defaults to {cloud_output_path}/{job_name}/predictions.csv.

  • hyperparameters – Model hyperparameters for inference. Overrides values passed to the constructor.

  • instance_type – Instance type for the prediction job. If None, uses registry default.

  • framework_version – Container framework version.

  • custom_image_uri – Custom Docker image URI for the container.

  • wait – If True, block and return the predictions. If False, return a JobPredictionFuture immediately — call .result() on it later to retrieve the predictions.

  • **backend_kwargs – Additional backend-specific arguments (e.g., job_name, volume_size).

Returns:

Predictions as a Series if wait=True; a JobPredictionFuture otherwise.

Return type:

pd.Series or JobPredictionFuture