predict_proba¶
- TabularCloudPredictor.predict_proba(test_data: str | DataFrame, *, include_predict: bool = True, 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]) tuple[Series, DataFrame | Series] | DataFrame | Series | None¶
Predict class probabilities with a SageMaker batch transform job.
Suited for large datasets. For low-latency predictions, deploy an endpoint with
deploy()instead. For regression, the “probabilities” are identical to the predictions.- Parameters:
test_data (str | pd.DataFrame) – Data to predict on, as a
pd.DataFrameor local path to a data file.include_predict (bool, default = True) – Whether to also return the predictions, saving a second batch transform job.
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:
tuple[pd.Series, pd.DataFrame | pd.Series] | pd.DataFrame | pd.Series | None –
(prediction, predict_probability)ifinclude_predict=True, otherwisepredict_probability.predict_probabilityis apd.DataFramewith one column per class, or apd.Seriesfor regression. Ifwait=False, returns(None, None)orNone, respectively.- 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.