predict_proba¶
- MultiModalCloudPredictor.predict_proba(test_data: str | DataFrame, test_data_image_column: str | None = None, include_predict: bool = True, predictor_path: str | None = None, framework_version: str | None = None, job_name: str | None = None, instance_type: str = 'ml.m5.2xlarge', instance_count: int = 1, custom_image_uri: str | None = None, wait: bool = True, predictions_path: str | None = None, backend_overrides: dict[str, dict[str, Any]] | None = None) tuple[Series, DataFrame | Series] | DataFrame | Series | None¶
Batch inference When minimizing latency isn’t a concern, then the batch transform functionality may be easier, more scalable, and more appropriate. If you want to minimize latency, deploy an endpoint with deploy() instead.
- Parameters:
test_data (str | pd.DataFrame) – The test data to be inferenced. Can be a
pd.DataFrame, or a local path to a csv.test_data_image_column (str, default = None) – If test_data involves image modality, you must specify the column name corresponding to image paths. The path MUST be an abspath
include_predict (bool, default = True) – Whether to include predict result along with predict_proba results. This flag can save you time from making two calls to get both the prediction and the probability as batch inference involves noticeable overhead.
predictor_path (str) – Path to the predictor tarball you want to use to predict. Path can be both a local path or a S3 location. If None, will use the most recent trained predictor trained with fit().
framework_version (str, optional) – AutoGluon version, e.g. “1.6”. Inference uses the official AutoGluon DLC image for this version. Defaults to the version used by fit(). If custom_image_uri is set, this argument will be ignored.
job_name (str, default = None) – Name of the launched training job. If None, CloudPredictor creates one with a predictor-specific prefix.
instance_count (int, default = 1,) – Number of instances used to do batch transform.
instance_type (str, default = 'ml.m5.2xlarge') – Instance to be used for batch transform.
wait (bool, default = True) – Whether to wait for batch transform to complete. To be noticed, the function won’t return immediately because there are some preparations needed prior transform.
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.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}}
- Returns:
tuple[pd.Series, pd.DataFrame | pd.Series] | pd.DataFrame | pd.Series | None – If wait is False, will return None or (None, None) if include_predict is True If wait is True and include_predict is True, will return (prediction, predict_probability), where prediction is a
pd.Seriesand predict_probability is apd.DataFrameor apd.Seriesthat’s identical to prediction when it’s a regression problem.
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.