predict¶
- MultiModalCloudPredictor.predict(test_data: str | DataFrame, test_data_image_column: str | None = None, predictor_path: str | None = None, framework_version: str = 'latest', 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) 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, use predict_real_time() instead.
- Parameters:
test_data (Union(str, pandas.DataFrame)) – The test data to be inferenced. Can be a pandas.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
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, default = latest) – Inference container version of autogluon. If latest, will use the latest available container version. If provided a specific version, will use this version. 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 (Optional[str], 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 (Optional[Dict[str, Dict[str, Any]]], default = None) – Escape hatch for SageMaker settings without a dedicated argument: raw request fields in the PascalCase format of the SageMaker API and boto3, deep-merged over the requests built by AutoGluon-Cloud. Valid keys:
"create_model"and"create_transform_job", e.g.{"create_transform_job": {"BatchStrategy": "SingleRecord", "MaxPayloadInMB": 20}}. Nested dicts merge recursively; other values, including lists, replace the generated ones. Only resources created by AutoGluon-Cloud are cleaned up.
- Returns:
Predict results in Series if wait is True None if wait is False
- Return type:
Optional Pandas.Series