AutoGluon-Cloud aims to provide user tools to train, fine-tune and deploy AutoGluon backed models on the cloud. With just a few lines of codes, users could train a model and perform inference on the cloud without worrying about MLOps details such as resource management.
Currently, AutoGluon-Cloud supports AWS SageMaker as the cloud backend.
# First install package from terminal:
# pip install -U pip
# pip install -U setuptools wheel
# pip install --pre autogluon.cloud # You don't need to install autogluon itself locally
from autogluon.cloud import TabularCloudPredictor
train_data = 'train.csv'
test_data = 'test.csv'
predictor_init_args = {label='label'} # init args you would pass to AG TabularPredictor
predictor_fit_args = {train_data, time_limit=120} # fit args you would pass to AG TabularPredictor
# Train
cloud_predictor = TabularCloudPredictor(cloud_output_path='YOUR_S3_BUCKET_PATH').fit(predictor_init_args, predictor_fit_args)
# Deploy the endpoint
cloud_predictor.deploy()
# Real-time inference with the endpoint
result = cloud_predictor.predict_real_time('test.csv')
print(result)
# Cleanup the endpoint
cloud_predictor.cleanup_deployment()
# Batch inference
cloud_predictor.predict('test.csv') # results will be stored in s3 bucket
cloud_predictor.download_predict_results() # download the results to your local machine