TabularCloudPredictor¶
- class autogluon.cloud.TabularCloudPredictor(local_output_path: str | None = None, cloud_output_path: str | None = None, backend: str = 'sagemaker', role: str | None = None, verbosity: int = 2)[source]¶
Train and deploy AutoGluon tabular models (classification and regression) on AWS SageMaker.
Wraps
autogluon.tabular.TabularPredictor(docs) and runsfit,predict, and endpoint deployment as managed SageMaker jobs.- Parameters:
local_output_path (Optional[str], default = None) – Path to directory where downloaded trained predictor, batch transform results, and intermediate outputs should be saved If unspecified, a time-stamped folder called “AutogluonCloudPredictor/ag-[TIMESTAMP]” will be created in the working directory to store all downloaded trained predictor, batch transform results, and intermediate outputs. Note: To call fit() twice and save all results of each fit, you must specify different local_output_path locations or don’t specify local_output_path at all. Otherwise files from first fit() will be overwritten by second fit().
cloud_output_path (Optional[str], default = None) –
S3 location where intermediate artifacts and trained models are stored. Accepts:
s3://bucket— a unique timestamped subfolderag-<timestamp>is appended, so each call gets its own folder and repeated runs don’t overwrite each other.s3://bucket/prefix— used verbatim. Re-running with the same prefix will overwrite previously written artifacts.None(default) — use the bucket saved in~/.autogluon/cloud.yaml(set byautogluon.cloud.bootstrap()/autogluon.cloud.register()) and append a timestamped subfolder. Raises if no bucket is configured.
backend (str, default = "sagemaker") – The backend to use. Valid options are: “sagemaker” and “ray_aws”. SageMaker backend supports training, deploying and batch inference on AWS SageMaker. Only single instance training is supported. RayAWS backend supports distributed training by creating an ephemeral ray cluster on AWS. Deployment and batch inferenc are not supported yet.
role (Optional[str], default = None) – ARN of the SageMaker execution role used to run training and inference jobs. If
None, falls back torole_arnin~/.autogluon/cloud.yaml(set byautogluon.cloud.bootstrap()/autogluon.cloud.register()), and finally tosagemaker.get_execution_role().verbosity (int, default = 2) – Verbosity levels range from 0 to 4 and control how much information is printed. Higher levels correspond to more detailed print statements (you can set verbosity = 0 to suppress warnings). If using logging, you can alternatively control amount of information printed via logger.setLevel(L), where L ranges from 0 to 50 (Note: higher values of L correspond to fewer print statements, opposite of verbosity levels).
Methods
Attach the current CloudPredictor to an existing endpoint.
Attach to a sagemaker training job.
Delete the deployed endpoint and other artifacts
Deploy a predictor to an endpoint, which can be used to do real-time inference later.
Detach the current endpoint and return it.
Download the trained predictor from the cloud.
Fit the predictor with the backend.
Get general info of the batch inference job.
Get the status of the batch inference job.
Get the output path in the cloud of the trained artifact
Get the status of the training job.
Return general info about CloudPredictor
Load the CloudPredictor
Batch inference.
Batch inference When minimizing latency isn't a concern, then the batch transform functionality may be easier, more scalable, and more appropriate.
Predict probability with the deployed endpoint.
Predict with the deployed endpoint.
Save the CloudPredictor so that user can later reload the predictor to gain access to deployed endpoint.
Convert the Cloud trained predictor to a local AutoGluon Predictor.
Attributes
backend_mapendpoint_nameReturn the CloudPredictor deployed endpoint name
is_fitWhether this CloudPredictor is fitted already
predictor_file_namepredictor_typeType of the underneath AutoGluon Predictor