AutoGluon Core

1.5.0 · active · verified Sun Apr 12

AutoGluon is an open-source AutoML library developed by AWS AI, designed to automate machine learning tasks with minimal code. It supports various data types, including tabular, image, text, and time series, enabling users to train and deploy highly accurate models efficiently. The current version is 1.5.0, with regular updates introducing new features, performance improvements, and bug fixes, typically on a quarterly major release cadence with interim patch releases.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to use AutoGluon's TabularPredictor for a classification task. It involves loading a dataset, fitting a predictor by specifying the target column, and then making predictions on new data. AutoGluon automatically handles model selection, hyperparameter tuning, and ensemble creation.

import pandas as pd
from autogluon.tabular import TabularPredictor, TabularDataset

# Create a dummy CSV for demonstration
data = {
    'feature1': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
    'feature2': ['A', 'B', 'A', 'C', 'B', 'A', 'C', 'B', 'A', 'C'],
    'target': [0, 1, 0, 1, 0, 1, 0, 1, 0, 1]
}
df = pd.DataFrame(data)
df.to_csv('train.csv', index=False)

# Load data using TabularDataset
train_data = TabularDataset('train.csv')

# Initialize and train a TabularPredictor
label = 'target'
predictor = TabularPredictor(label=label, path='AutogluonModels').fit(train_data)

# Make predictions (example test data)
test_data = TabularDataset(pd.DataFrame({
    'feature1': [11, 12, 13],
    'feature2': ['A', 'B', 'C']
}))
predictions = predictor.predict(test_data)

print("Predictions:")
print(predictions)

view raw JSON →