AutoGluon: AutoML for Text, Image, Time Series, and Tabular Data

ReleaseVersion StableVersion PythonVersion License Downloads GitHub Twitter

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.

Note

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)

Installation

Note

AutoGluon requires Python version 3.8, 3.9 or 3.10. For troubleshooting the installation process, you can check the Installation FAQ.

Select your preferences below and run the corresponding install commands:

OS: Linux Mac Mac - Apple Silicon Windows

Linux.
Mac OSX.
Mac OSX - Apple Silicon.
Windows.

Version: PIP Source

PIP Release.
Install AutoGluon from source.

Backend: CPU GPU

Built-in backend for CPU.
Required to run on Nvidia GPUs.

Command:

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.13.1+cpu torchvision==0.14.1+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html

pip3 install autogluon
pip3 install -U pip
pip3 install -U setuptools wheel

# Install the proper version of PyTorch following https://pytorch.org/get-started/locally/
pip3 install torch==1.13.1+cu116 torchvision==0.14.1+cu116 --extra-index-url https://download.pytorch.org/whl/cu116

pip3 install autogluon
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.13.1+cpu torchvision==0.14.1+cpu --extra-index-url https://download.pytorch.org/whl/cpu

git clone https://github.com/autogluon/autogluon
cd autogluon && ./full_install.sh
pip3 install -U pip
pip3 install -U setuptools wheel

# Install the proper version of PyTorch following https://pytorch.org/get-started/locally/
pip3 install torch==1.13.1+cu116 torchvision==0.14.1+cu116 --extra-index-url https://download.pytorch.org/whl/cu116

git clone https://github.com/autogluon/autogluon
cd autogluon && ./full_install.sh

Note

If you don’t have them, please first install: XCode, Homebrew, LibOMP. Once you have Homebrew, LibOMP can be installed via:

# brew install wget
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb
# Uninstall libomp if it was previous installed
# brew uninstall libomp
brew install libomp.rb
rm libomp.rb

WARNING: Do not install LibOMP via “brew install libomp” as LibOMP 12 and 13 can cause segmentation faults with LightGBM and XGBoost.

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.13.1+cpu torchvision==0.14.1+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html

pip3 install autogluon

Note

GPU usage is not yet supported on Mac OSX, please use Linux or Windows to utilize GPUs in AutoGluon.

Note

If you don’t have them, please first install: XCode, Homebrew, LibOMP. Once you have Homebrew, LibOMP can be installed via:

# brew install wget
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb
# Uninstall libomp if it was previous installed
# brew uninstall libomp
brew install libomp.rb
rm libomp.rb

WARNING: Do not install LibOMP via “brew install libomp” as LibOMP 12 and 13 can cause segmentation faults with LightGBM and XGBoost.

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.13.1+cpu torchvision==0.14.1+cpu --extra-index-url https://download.pytorch.org/whl/cpu

git clone https://github.com/autogluon/autogluon
cd autogluon && ./full_install.sh

Note

GPU usage is not yet supported on Mac OSX, please use Linux or Windows to utilize GPUs in AutoGluon.

Note

If you are using Apple silicon hardware, please get the latest info in M1 and M2 discussion threads on github.

Note

GPU usage is not yet supported on Mac OSX, please use Linux or Windows to utilize GPUs in AutoGluon.

Note

If you are using Apple silicon hardware, please get the latest info in M1 and M2 discussion threads on github.

Note

GPU usage is not yet supported on Mac OSX, please use Linux or Windows to utilize GPUs in AutoGluon.

Note

If you run into difficulties installing AutoGluon on Windows, please provide details in this GitHub Issue.

To install AutoGluon on Windows, it is recommended to use Anaconda:

  1. Install Anaconda
    • If Anaconda is already installed but is an old version, follow this guide to update

  2. Open Anaconda Prompt (anaconda3)

  3. Inside Anaconda Prompt, do the following:

conda create -n myenv python=3.9 -y
conda activate myenv
  1. Continue with the remaining installation steps using the conda environment created above

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.13.1+cpu torchvision==0.14.1+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html

pip3 install autogluon

Note

If you run into difficulties installing AutoGluon on Windows, please provide details in this GitHub Issue.

To install AutoGluon on Windows, it is recommended to use Anaconda:

  1. Install Anaconda
    • If Anaconda is already installed but is an old version, follow this guide to update

  2. Open Anaconda Prompt (anaconda3)

  3. Inside Anaconda Prompt, do the following:

conda create -n myenv python=3.9 cudatoolkit=11.3 -y
conda activate myenv
  1. Install the proper GPU PyTorch version by following the PyTorch Install Documentation (Recommended). Alternatively, use the following command:

pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 --extra-index-url https://download.pytorch.org/whl/cu116
  1. Sanity check that your installation is valid and can detect your GPU via testing in Python:

import torch
print(torch.cuda.is_available())  # Should be True
print(torch.cuda.device_count())  # Should be > 0
  1. Continue with the remaining installation steps using the conda environment created above

pip3 install -U pip
pip3 install -U setuptools wheel

# Install the proper version of PyTorch following https://pytorch.org/get-started/locally/
pip3 install torch==1.13.1+cu116 torchvision==0.14.1+cu116 --extra-index-url https://download.pytorch.org/whl/cu116

pip3 install autogluon

Note

If you run into difficulties installing AutoGluon on Windows, please provide details in this GitHub Issue.

To install AutoGluon on Windows, it is recommended to use Anaconda:

  1. Install Anaconda
    • If Anaconda is already installed but is an old version, follow this guide to update

  2. Open Anaconda Prompt (anaconda3)

  3. Inside Anaconda Prompt, do the following:

conda create -n myenv python=3.9 -y
conda activate myenv
  1. Continue with the remaining installation steps using the conda environment created above

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.13.1+cpu torchvision==0.14.1+cpu --extra-index-url https://download.pytorch.org/whl/cpu

git clone https://github.com/autogluon/autogluon
cd autogluon && ./full_install.sh

Note

If you run into difficulties installing AutoGluon on Windows, please provide details in this GitHub Issue.

To install AutoGluon on Windows, it is recommended to use Anaconda:

  1. Install Anaconda
    • If Anaconda is already installed but is an old version, follow this guide to update

  2. Open Anaconda Prompt (anaconda3)

  3. Inside Anaconda Prompt, do the following:

conda create -n myenv python=3.9 cudatoolkit=11.3 -y
conda activate myenv
  1. Install the proper GPU PyTorch version by following the PyTorch Install Documentation (Recommended). Alternatively, use the following command:

pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 --extra-index-url https://download.pytorch.org/whl/cu116
  1. Sanity check that your installation is valid and can detect your GPU via testing in Python:

import torch
print(torch.cuda.is_available())  # Should be True
print(torch.cuda.device_count())  # Should be > 0
  1. Continue with the remaining installation steps using the conda environment created above

pip3 install -U pip
pip3 install -U setuptools wheel

# Install the proper version of PyTorch following https://pytorch.org/get-started/locally/
pip3 install torch==1.13.1+cu116 torchvision==0.14.1+cu116 --extra-index-url https://download.pytorch.org/whl/cu116

git clone https://github.com/autogluon/autogluon
cd autogluon && ./full_install.sh

AutoGluon is modularized into sub-modules specialized for tabular, text, image, or time series data. You can reduce the number of dependencies required by solely installing a specific sub-module via: python3 -m pip install <submodule>, where <submodule> may be one of the following options:

  • autogluon.tabular - functionality for tabular data (TabularPredictor)
    • The default installation of autogluon.tabular standalone is a skeleton installation.

    • Install via pip install autogluon.tabular[all] to get the same installation of tabular as via pip install autogluon

    • Available optional dependencies: lightgbm,catboost,xgboost,fastai. These are included in all.

    • Optional dependencies not included in all: vowpalwabbit,imodels,skex.

    • To run 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. Use pip install autogluon.tabular[all,skex] to enable, or pip install “scikit-learn-intelex<2021.5” after a standard installation of AutoGluon.

    • Optional Dependency: vowpalwabbit. This will install the VowpalWabbit package and allow you to fit VowpalWabbit in TabularPredictor.

    • Optional Dependency: imodels. This will install the imodels package and allow you to fit interpretable models in TabularPredictor.

  • autogluon.multimodal - functionality for image, text, and multimodal problems. Focus on deep learning models.
    • To try object detection functionality using MultiModalPredictor, please install additional dependencies via mim install mmcv-full, pip install mmdet and pip install pycocotools. Note that Windows users should also install pycocotools` by: pip install pycocotools-windows, but it only supports python 3.6/3.7/3.8.

  • autogluon.timeseries - only functionality for time series data (TimeSeriesPredictor)

  • autogluon.common - helper functionality. Not useful standalone.

  • autogluon.core - only core functionality (Searcher/Scheduler) useful for hyperparameter tuning of arbitrary code/models.

  • autogluon.features - only functionality for feature generation / feature preprocessing pipelines (primarily related to Tabular data).

To install a submodule from source, follow the instructions for installing the entire package from source but replace the line cd autogluon && ./full_install.sh with cd autogluon && python3 -m pip install -e {SUBMODULE_NAME}/{OPTIONAL_DEPENDENCIES}

  • For example, to install autogluon.tabular[lightgbm,catboost] from source, the command would be: cd autogluon && python3 -m pip install -e tabular/[lightgbm,catboost]

To install all AutoGluon optional dependencies:

pip install autogluon && pip install autogluon.tabular[vowpalwabbit,imodels,skex]

Quick Start

code/autogluon/docs/tutorials/multimodal/image_prediction/beginner_image_cls.md
Application Illustration
Tabular Prediction:
predict values in column
of data table based on
other columns' values
Image Prediction:
recognize the main object
in an image
Object Detection:
detect multiple objects
with their bounding boxes
in an image
Text Prediction:
make predictions based
on text content
   

Tutorials

Tabular Predictiontutorials/tabular_prediction/index.html

How to predict variables in tabular datasets.

Multimodal Predictiontutorials/multimodal/index.html

How to solve problems that contain Image, Text, and Tabular features at the same time.

Time Series Forecastingtutorials/timeseries/index.html

How to train time series models for forecasting.

Exploratory Data Analysistutorials/eda/index.html

Tools to explore and visualize data.

Managed Solutions Featuring AutoGluon

Launch Tutorial Notebooks