predict¶
- TabularCloudPredictor.predict(test_data: str | DataFrame, *, predictor_path: str | None = None, framework_version: str | None = None, instance_type: str = 'ml.m5.2xlarge', wait: bool = True, predictions_path: str | None = None, backend_overrides: dict[str, dict[str, Any]] | None = None, **kwargs: Unpack[BatchTransformKwargs]) Series | None¶
Predict with a SageMaker batch transform job.
Suited for large datasets. For low-latency predictions, deploy an endpoint with
deploy()instead.- Parameters:
test_data (str | pd.DataFrame) – Data to predict on, as a
pd.DataFrameor local path to a data file.predictor_path (str | None, default = None) – Local or S3 path of the predictor tarball. If
None, uses the predictor trained byfit().framework_version (str | None, default = None) – AutoGluon version, e.g.
"1.6". Inference uses the official AutoGluon DLC image for this version. Defaults to the version used byfit(). Ignored ifcustom_image_uriis set.instance_type (str, default = "ml.m5.2xlarge") – Instance type of the batch transform job.
wait (bool, default = True) – Whether to block until the job completes and return the predictions. If
False, returnsNoneonce the job is launched; useget_batch_inference_job_status()to poll it.predictions_path (str | None, default = None) – S3 prefix under which the batch transform job writes its results (
<predictions_path>/<input file>.out). Defaults to{cloud_output_path}/batch_transform/<timestamp>/results.
- Returns:
pd.Series | None – Predictions, or
Noneifwait=False.- Other Parameters:
backend_overrides (dict[str, dict[str, Any]] | None, default = None) – Raw SageMaker request fields for settings without a dedicated argument.
Keys: request names from the SageMaker API section below.
Values: request fields in PascalCase, as in the SageMaker API and boto3. Deep-merged over the request built by AutoGluon-Cloud; lists and other non-dict values replace the generated ones.
Example:
{"CreateTransformJob": {"BatchStrategy": "SingleRecord", "MaxPayloadInMB": 20}}
job_name (str | None, default = None) – Name of the batch transform job. Defaults to a unique name with prefix
ag-cloud-<predictor_type>.instance_count (int, default = 1) – Number of batch transform instances.
custom_image_uri (str | None, default = None) – Custom inference container image URI. If set,
framework_versionis ignored.
SageMaker API
CreateModel: registers the predictor artifact and inference image as a SageMaker model.
CreateTransformJob: runs batch inference on
instance_countxinstance_type. Results are written topredictions_path.
The model is deleted when the job finishes. With
wait=Falseit is kept; delete it with DeleteModel.