Skip to main content

A package for automated machine learning based on scikit-learn.

Project description

GAMA

Genetic Automated Machine learning Assistant
An automated machine learning tool based on genetic programming.
Make sure to check out the documentation.

Build Status codecov DOI


GAMA is an AutoML package for end-users and AutoML researchers. It generates optimized machine learning pipelines given specific input data and resource constraints. A machine learning pipeline contains data preprocessing (e.g. PCA, normalization) as well as a machine learning algorithm (e.g. Logistic Regression, Random Forests), with fine-tuned hyperparameter settings (e.g. number of trees in a Random Forest).

To find these pipelines, multiple search procedures have been implemented. GAMA can also combine multiple tuned machine learning pipelines together into an ensemble, which on average should help model performance. At the moment, GAMA is restricted to classification and regression problems on tabular data.

In addition to its general use AutoML functionality, GAMA aims to serve AutoML researchers as well. During the optimization process, GAMA keeps an extensive log of progress made. Using this log, insight can be obtained on the behaviour of the search procedure. For example, it can produce a graph that shows pipeline fitness over time: graph of fitness over time

For more examples and information on the visualization, see the technical guide.

Installing GAMA

You can install GAMA with pip: pip install gama

Minimal Example

The following example uses AutoML to find a machine learning pipeline that classifies breast cancer as malign or benign. See the documentation for examples in classification, regression, using ARFF as input.

from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from sklearn.metrics import log_loss, accuracy_score
from gama import GamaClassifier

if __name__ == '__main__':
    X, y = load_breast_cancer(return_X_y=True)
    X_train, X_test, y_train, y_test = train_test_split(X, y, stratify=y, random_state=0)

    automl = GamaClassifier(max_total_time=180, keep_analysis_log=None)
    print("Starting `fit` which will take roughly 3 minutes.")
    automl.fit(X_train, y_train)

    label_predictions = automl.predict(X_test)
    probability_predictions = automl.predict_proba(X_test)

    print('accuracy:', accuracy_score(y_test, label_predictions))
    print('log loss:', log_loss(y_test, probability_predictions))
    # the `score` function outputs the score on the metric optimized towards (by default, `log_loss`)
    print('log_loss', automl.score(X_test, y_test))

note: By default, GamaClassifier optimizes towards log_loss.

Citing

If you want to cite GAMA, please use our JOSS publication.

@article{Gijsbers2019,
  doi = {10.21105/joss.01132},
  url = {https://doi.org/10.21105/joss.01132},
  year  = {2019},
  month = {jan},
  publisher = {The Open Journal},
  volume = {4},
  number = {33},
  pages = {1132},
  author = {Pieter Gijsbers and Joaquin Vanschoren},
  title = {{GAMA}: Genetic Automated Machine learning Assistant},
  journal = {Journal of Open Source Software}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gama-19.11.0.tar.gz (66.3 kB view details)

Uploaded Source

Built Distribution

gama-19.11.0-py3-none-any.whl (76.8 kB view details)

Uploaded Python 3

File details

Details for the file gama-19.11.0.tar.gz.

File metadata

  • Download URL: gama-19.11.0.tar.gz
  • Upload date:
  • Size: 66.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0.post20191030 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.8.0

File hashes

Hashes for gama-19.11.0.tar.gz
Algorithm Hash digest
SHA256 79f64324539a095653c41f409e9b7800cd3396d7ebb669ae03373d65fbcefbbc
MD5 05802c2afd1554d0952bae1ed63a89f5
BLAKE2b-256 b82ecae5088a1a32044c2d9d6fca3b964708c2afa667c40010f93d25c614fb97

See more details on using hashes here.

File details

Details for the file gama-19.11.0-py3-none-any.whl.

File metadata

  • Download URL: gama-19.11.0-py3-none-any.whl
  • Upload date:
  • Size: 76.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0.post20191030 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.8.0

File hashes

Hashes for gama-19.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8e60494e751e1e7c9e9c381df3a90b1ece5734d81b0bfcd31f3b426998dab2d
MD5 cc8ee2b167bcc6341b2c8c676192752e
BLAKE2b-256 05127e2939d7a0693faf2371ef2cd0ab98c259ba0a9c7ebff68413f87fb8028b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page