AutoGluon-Cloud: Train and Deploy AutoGluon on the Cloud
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 code, users can train a model and perform inference on the cloud without worrying about MLOps details such as resource management.
Currently, AutoGluon-Cloud supports Amazon SageMaker as the cloud backend.
importpandasaspdfromautogluon.cloudimportTabularCloudPredictortrain_data=pd.read_csv("https://autogluon.s3.amazonaws.com/datasets/Inc/train.csv")test_data=pd.read_csv("https://autogluon.s3.amazonaws.com/datasets/Inc/test.csv")test_data.drop(columns=["class"],inplace=True)cloud_predictor=TabularCloudPredictor(cloud_output_path="YOUR_S3_BUCKET_PATH")cloud_predictor.fit(train_data=train_data,# path or DataFramepredictor_init_args={"label":"class"},# passed to TabularPredictor()predictor_fit_args={"time_limit":120},# passed to TabularPredictor.fit())cloud_predictor.deploy()result=cloud_predictor.predict_real_time(test_data)cloud_predictor.cleanup_deployment()# Batch inferenceresult=cloud_predictor.predict(test_data)
Multimodal
importpandasaspdfromautogluon.cloudimportMultiModalCloudPredictortrain_data=pd.read_parquet("https://autogluon-text.s3-accelerate.amazonaws.com/glue/sst/train.parquet")test_data=pd.read_parquet("https://autogluon-text.s3-accelerate.amazonaws.com/glue/sst/dev.parquet")test_data.drop(columns=["label"],inplace=True)cloud_predictor=MultiModalCloudPredictor(cloud_output_path="YOUR_S3_BUCKET_PATH")cloud_predictor.fit(train_data=train_data,# path or DataFramepredictor_init_args={"label":"label"},# passed to MultiModalPredictor())cloud_predictor.deploy()result=cloud_predictor.predict_real_time(test_data)cloud_predictor.cleanup_deployment()# Batch inferenceresult=cloud_predictor.predict(test_data)
TimeSeries
importpandasaspdfromautogluon.cloudimportTimeSeriesCloudPredictordata=pd.read_csv("https://autogluon.s3.amazonaws.com/datasets/timeseries/m4_hourly_tiny/train.csv")cloud_predictor=TimeSeriesCloudPredictor(cloud_output_path="YOUR_S3_BUCKET_PATH")cloud_predictor.fit(train_data=data,# path or DataFramepredictor_init_args={"target":"target","prediction_length":24},# passed to TimeSeriesPredictor()predictor_fit_args={"time_limit":120},# passed to TimeSeriesPredictor.fit()id_column="item_id",timestamp_column="timestamp",)cloud_predictor.deploy()result=cloud_predictor.predict_real_time(data)cloud_predictor.cleanup_deployment()# Batch inferenceresult=cloud_predictor.predict(data)
pipinstall-Upip
pipinstall-Usetuptoolswheel
pipinstall--preautogluon.cloud# You don't need to install autogluon itself locally
pipinstall-Usagemaker# This is required to ensure the information about newly released containers is available.