Convert Figma logo to code with AI

keras-team logoautokeras

AutoML library for deep learning

9,129
1,401
9,129
145

Top Related Projects

6,229

Google Brain AutoML

14,014

An open source AutoML toolkit for automate machine learning lifecycle, including feature engineering, neural architecture search, model compression and hyper-parameter tuning.

Automated Machine Learning with scikit-learn

Python package for AutoML on Tabular Data with Feature Engineering, Hyper-Parameters Tuning, Explanations and Automatic Documentation

9,709

A Python Automated Machine Learning tool that optimizes machine learning pipelines using genetic programming.

10,708

A hyperparameter optimization framework

Quick Overview

AutoKeras is an open-source library for automated machine learning (AutoML). It provides an easy-to-use interface for automatically searching for architectures and hyperparameters of deep learning models. AutoKeras is built on top of Keras and TensorFlow, making it accessible to both beginners and experienced practitioners in the field of machine learning.

Pros

  • User-friendly API that simplifies the process of building and optimizing neural networks
  • Supports various types of data, including image, text, and structured data
  • Integrates well with the Keras ecosystem and TensorFlow backend
  • Continuously updated and maintained by an active community

Cons

  • May not always find the optimal model architecture for complex problems
  • Limited customization options compared to manual model building
  • Can be computationally expensive and time-consuming for large datasets
  • Documentation could be more comprehensive for advanced use cases

Code Examples

  1. Image Classification:
import autokeras as ak

# Initialize the image classifier
clf = ak.ImageClassifier(max_trials=10, overwrite=True)

# Fit the model
clf.fit(x_train, y_train, epochs=10)

# Evaluate on the test set
accuracy = clf.evaluate(x_test, y_test)[1]
print(f"Accuracy: {accuracy}")
  1. Text Classification:
import autokeras as ak

# Initialize the text classifier
clf = ak.TextClassifier(max_trials=5, overwrite=True)

# Fit the model
clf.fit(x_train, y_train, epochs=5)

# Get the best model
model = clf.export_model()
  1. Structured Data Regression:
import autokeras as ak

# Initialize the structured data regressor
reg = ak.StructuredDataRegressor(max_trials=3, overwrite=True)

# Fit the model
reg.fit(x_train, y_train, validation_data=(x_val, y_val))

# Make predictions
predictions = reg.predict(x_test)

Getting Started

To get started with AutoKeras, follow these steps:

  1. Install AutoKeras:
pip install autokeras
  1. Import the library and create a model:
import autokeras as ak

# For image classification
model = ak.ImageClassifier(max_trials=10)

# For text classification
model = ak.TextClassifier(max_trials=10)

# For structured data
model = ak.StructuredDataClassifier(max_trials=10)
  1. Fit the model to your data:
model.fit(x_train, y_train, epochs=10)
  1. Evaluate or make predictions:
# Evaluate
accuracy = model.evaluate(x_test, y_test)[1]

# Predict
predictions = model.predict(x_test)

Competitor Comparisons

6,229

Google Brain AutoML

Pros of AutoML

  • Integrated with Google Cloud Platform, offering scalable infrastructure
  • Supports a wide range of ML tasks, including vision, natural language, and tabular data
  • Provides advanced features like model deployment and monitoring

Cons of AutoML

  • Requires Google Cloud account and associated costs
  • Less flexibility for customization compared to open-source alternatives
  • Limited local development options, primarily cloud-based

Code Comparison

AutoML (using Python client library):

from google.cloud import automl_v1beta1 as automl

client = automl.AutoMlClient()
project_id = "your-project-id"
dataset = client.create_dataset(project_id, {"display_name": "my_dataset"})

AutoKeras:

import autokeras as ak

clf = ak.ImageClassifier()
clf.fit(x_train, y_train)
results = clf.predict(x_test)

AutoML focuses on cloud-based solutions with a client-server architecture, while AutoKeras provides a more traditional local development experience. AutoML offers a broader range of pre-built models and automated pipelines, whereas AutoKeras allows for more customization and experimentation within the Keras ecosystem.

14,014

An open source AutoML toolkit for automate machine learning lifecycle, including feature engineering, neural architecture search, model compression and hyper-parameter tuning.

Pros of NNI

  • Supports a wider range of ML frameworks (TensorFlow, PyTorch, Keras, etc.)
  • Offers more advanced hyperparameter tuning algorithms
  • Provides visualization tools for experiment tracking and analysis

Cons of NNI

  • Steeper learning curve due to more complex configuration
  • Requires more manual setup compared to AutoKeras' simplicity
  • Less focus on automated model architecture search

Code Comparison

AutoKeras:

import autokeras as ak

model = ak.ImageClassifier()
model.fit(x_train, y_train)
results = model.predict(x_test)

NNI:

import nni

@nni.trace
def train_model(params):
    model = create_model(params)
    model.fit(x_train, y_train)
    return model.evaluate(x_test, y_test)

if __name__ == '__main__':
    nni.run(train_model)

AutoKeras provides a higher-level API for quick and easy model creation, while NNI offers more flexibility and control over the optimization process. AutoKeras focuses on automated neural architecture search, whereas NNI emphasizes hyperparameter tuning across various ML frameworks.

Automated Machine Learning with scikit-learn

Pros of auto-sklearn

  • Supports a wider range of ML algorithms, including traditional methods
  • More extensive hyperparameter optimization capabilities
  • Better suited for tabular data and non-deep learning tasks

Cons of auto-sklearn

  • Less focus on deep learning models compared to AutoKeras
  • May require more computational resources for extensive search
  • Steeper learning curve for beginners due to more complex configuration options

Code Comparison

AutoKeras:

import autokeras as ak

clf = ak.StructuredDataClassifier(max_trials=10)
clf.fit(x_train, y_train)
results = clf.predict(x_test)

auto-sklearn:

import autosklearn.classification

automl = autosklearn.classification.AutoSklearnClassifier(time_left_for_this_task=120)
automl.fit(X_train, y_train)
predictions = automl.predict(X_test)

Both libraries aim to automate the machine learning pipeline, but AutoKeras focuses more on deep learning and neural architecture search, while auto-sklearn covers a broader range of traditional machine learning algorithms. AutoKeras is generally easier to use for beginners, especially those familiar with Keras, while auto-sklearn offers more flexibility and control over the AutoML process. The choice between the two depends on the specific requirements of the project and the user's expertise level.

Python package for AutoML on Tabular Data with Feature Engineering, Hyper-Parameters Tuning, Explanations and Automatic Documentation

Pros of mljar-supervised

  • Supports a wider range of machine learning algorithms, including tree-based models and linear models
  • Provides more detailed explanations and interpretability features for models
  • Offers easier integration with pandas DataFrames and scikit-learn workflows

Cons of mljar-supervised

  • Less focus on deep learning and neural network architectures
  • May require more manual configuration for complex tasks
  • Smaller community and ecosystem compared to AutoKeras

Code Comparison

mljar-supervised:

from supervised import AutoML

automl = AutoML(results_path="automl_results")
automl.fit(X, y)
predictions = automl.predict(X_test)

AutoKeras:

import autokeras as ak

clf = ak.StructuredDataClassifier()
clf.fit(X, y)
predictions = clf.predict(X_test)

Both libraries aim to automate the machine learning pipeline, but mljar-supervised offers a broader range of traditional ML algorithms and interpretability features. AutoKeras, on the other hand, focuses more on deep learning and neural network architectures. The choice between the two depends on the specific requirements of your project and the type of models you want to explore.

9,709

A Python Automated Machine Learning tool that optimizes machine learning pipelines using genetic programming.

Pros of TPOT

  • Supports a wider range of machine learning algorithms, including traditional ML methods
  • Offers more flexibility in pipeline optimization, allowing for complex multi-step preprocessing
  • Provides detailed reports on the best-performing models and feature importance

Cons of TPOT

  • Generally slower than AutoKeras, especially for large datasets or complex search spaces
  • Less focus on deep learning models compared to AutoKeras
  • Steeper learning curve for users new to genetic programming concepts

Code Comparison

TPOT:

from tpot import TPOTClassifier
tpot = TPOTClassifier(generations=5, population_size=20, verbosity=2)
tpot.fit(X_train, y_train)
print(tpot.score(X_test, y_test))
tpot.export('tpot_pipeline.py')

AutoKeras:

import autokeras as ak
clf = ak.StructuredDataClassifier(max_trials=5)
clf.fit(X_train, y_train, epochs=10)
print(clf.evaluate(X_test, y_test))
model = clf.export_model()

Both libraries aim to automate the machine learning pipeline, but TPOT focuses on traditional ML algorithms and genetic programming, while AutoKeras emphasizes deep learning and neural architecture search. TPOT offers more flexibility in pipeline construction, while AutoKeras provides a simpler interface for deep learning tasks.

10,708

A hyperparameter optimization framework

Pros of Optuna

  • More flexible and general-purpose, supporting various ML frameworks beyond just Keras
  • Offers advanced hyperparameter optimization techniques like pruning and parallel optimization
  • Provides extensive visualization tools for analyzing optimization results

Cons of Optuna

  • Requires more manual configuration and coding compared to AutoKeras' automated approach
  • Less integrated with Keras, potentially requiring more setup for Keras-specific projects
  • Steeper learning curve for beginners due to its broader scope and flexibility

Code Comparison

AutoKeras:

import autokeras as ak

model = ak.ImageClassifier()
model.fit(x_train, y_train)
results = model.predict(x_test)

Optuna:

import optuna

def objective(trial):
    params = {
        'learning_rate': trial.suggest_loguniform('learning_rate', 1e-5, 1e-1),
        'num_layers': trial.suggest_int('num_layers', 1, 5),
    }
    model = create_model(params)
    return train_and_evaluate(model)

study = optuna.create_study(direction='maximize')
study.optimize(objective, n_trials=100)

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

logo

codecov PyPI version Python Tensorflow contributions welcome

Official Website: autokeras.com

AutoKeras: An AutoML system based on Keras. It is developed by DATA Lab at Texas A&M University. The goal of AutoKeras is to make machine learning accessible to everyone.

Learning resources

  • A short example.
import autokeras as ak

clf = ak.ImageClassifier()
clf.fit(x_train, y_train)
results = clf.predict(x_test)

drawing     drawing

Installation

To install the package, please use the pip installation as follows:

pip3 install autokeras

Please follow the installation guide for more details.

Note: Currently, AutoKeras is only compatible with Python >= 3.7 and TensorFlow >= 2.8.0.

Community

Ask your questions on our GitHub Discussions.

Contributing Code

Here is how we manage our project.

We pick the critical issues to work on from GitHub issues. They will be added to this Project. Some of the issues will then be added to the milestones, which are used to plan for the releases.

Refer to our Contributing Guide to learn the best practices.

Thank all the contributors!

The contributors

Cite this work

Haifeng Jin, François Chollet, Qingquan Song, and Xia Hu. "AutoKeras: An AutoML Library for Deep Learning." the Journal of machine Learning research 6 (2023): 1-6. (Download)

Biblatex entry:

@article{JMLR:v24:20-1355,
  author  = {Haifeng Jin and François Chollet and Qingquan Song and Xia Hu},
  title   = {AutoKeras: An AutoML Library for Deep Learning},
  journal = {Journal of Machine Learning Research},
  year    = {2023},
  volume  = {24},
  number  = {6},
  pages   = {1--6},
  url     = {http://jmlr.org/papers/v24/20-1355.html}
}

Acknowledgements

The authors gratefully acknowledge the D3M program of the Defense Advanced Research Projects Agency (DARPA) administered through AFRL contract FA8750-17-2-0116; the Texas A&M College of Engineering, and Texas A&M University.