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.DataFrame or 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 by fit().

  • 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 by fit(). Ignored if custom_image_uri is 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, returns None once the job is launched; use get_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) if include_predict=True, otherwise predict_probability. predict_probability is a pd.DataFrame with one column per class, or a pd.Series for regression. If wait=False, returns (None, None) or None, 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_version is ignored.

SageMaker API

  • CreateModel: registers the predictor artifact and inference image as a SageMaker model.

  • CreateTransformJob: runs batch inference on instance_count x instance_type. Results are written to predictions_path.

The model is deleted when the job finishes. With wait=False it is kept; delete it with DeleteModel.