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_dataprovides the few-shot context andtest_datacontains the rows to predict on.- Parameters:
test_data – Data to predict on. Must contain every feature column present in
train_dataexceptlabel.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
JobPredictionFutureimmediately — 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; aJobPredictionFutureotherwise.- Return type:
pd.Series or JobPredictionFuture