‘autogluon’ – AI/ML Model -MultiModalPredictor

In January 2020 Amazon Web Services Inc. (AWS) launched an open-source library called AutoGluon the library behind Sagemaker Autopilot.

AutoGluon enables developers to write machine learning-based applications that use image, text or tabular data sets with just a few lines of code.

autogluon.forecasting module automatically processes raw time series data into the appropriate format, and then trains and tunes various state-of-the-art deep learning models to produce accurate forecasts.

Autogluon.tabular with only the optional LightGBM and CatBoost models for example, you can do: pip install autogluon.tabular [lightgbm,catboost] Experimental optional dependency: skex. This will speedup KNN models by 25x in training and inference on CPU.

AutoML packages are: AutoGluon (2020): This popular AutoML open-source toolkit developed by AWS helps in getting a strong predictive performance in various machine learning and deep learning models on text, image, and tabular data.

“AutoGluon enables easy-to-use and easy-to-extend AutoML with a focus on deep learning and real-world applications spanning image, text, or tabular data. Intended for both ML beginners and experts, AutoGluon enables you to… “

  • quickly prototype deep learning solutions
  • automatic hyperparameter tuning, model selection/architecture search
  • improve existing bespoke models and data pipelines **

AutoGluon enables you to build machine learning models with only 3 Lines of Code.

Currently, AutoGluon can create models for image classification, object detection, text classification, and supervised learning with tabular datasets.

AutoGluon enables easy-to-use and easy-to-extend AutoML with a focus on automated stack ensembling, deep learning, and real-world applications spanning image, text, and tabular data. Intended for both ML beginners and experts, AutoGluon enables you to:

  • Quickly prototype deep learning and classical ML solutions for your raw data with a few lines of code.
  • Automatically utilize state-of-the-art techniques (where appropriate) without expert knowledge.
  • Leverage automatic hyperparameter tuning, model selection/ensembling, architecture search, and data processing.
  • Easily improve/tune your bespoke models and data pipelines, or customize AutoGluon for your use-case.


Example using AutoGluon to train and deploy a high-performance model on a tabular dataset:

>>> from autogluon.tabular import TabularDataset, TabularPredictor
>>> train_data = TabularDataset('https://autogluon.s3.amazonaws.com/datasets/Inc/train.csv')
>>> test_data = TabularDataset('https://autogluon.s3.amazonaws.com/datasets/Inc/test.csv')
>>> predictor = TabularPredictor(label='class').fit(train_data=train_data)
>>> predictions = predictor.predict(test_data)

AutoGluon can be applied for prediction tasks that involve image and text data. For adopting state-of-the-art deep learning models for multimodal prediction problems, you may try autogluon.multimodal:

>>> from autogluon.multimodal import MultiModalPredictor
>>> from datasets import load_dataset
>>> train_data = load_dataset("glue", 'mrpc')['train'].to_pandas().drop('idx', axis=1)
>>> test_data = load_dataset("glue", 'mrpc')['validation'].to_pandas().drop('idx', axis=1)
>>> predictor = MultiModalPredictor(label='label').fit(train_data)
>>> predictions = predictor.predict(test_data)
>>> score = predictor.evaluate(test_data)

Example using AutoGluon to forecast future values of time series:

>>> from autogluon.timeseries import TimeSeriesDataFrame, TimeSeriesPredictor
>>> data = TimeSeriesDataFrame('https://autogluon.s3.amazonaws.com/datasets/timeseries/m4_hourly/train.csv')
>>> predictor = TimeSeriesPredictor(target='target', prediction_length=48).fit(data)
>>> predictions = predictor.predict(data)

pip3 install -U pip
pip3 install -U setuptools wheel

# CPU version of pytorch has smaller footprint - see installation instructions in
# pytorch documentation - https://pytorch.org/get-started/locally/
pip3 install torch==1.12.1+cpu torchvision==0.13.1+cpu torchtext==0.13.1 -f https://download.pytorch.org/whl/cpu/torch_stable.html

pip3 install autogluon