Skip to main content

A fast and lightweight autoML system

Reason this release was yanked:

settings.json missing in the wheel

Project description

FLAML - Fast and Lightweight AutoML

FLAML is a Python library designed to automatically produce accurate machine learning models with low computational cost. It frees users from selecting learners and hyperparameters for each learner. It is fast and cheap. The simple and lightweight design makes it easy to extend, such as adding customized learners or metrics. FLAML is powered by a new, cost-effective hyperparameter optimization and learner selection method invented by Microsoft Research. FLAML is easy to use:

  1. With three lines of code, you can start using this economical and fast AutoML engine as a scikit-learn style estimator.
from flaml import AutoML
automl = AutoML()
automl.fit(X_train, y_train, task="classification")
  1. You can restrict the learners and use FLAML as a fast hyperparameter tuning tool for XGBoost, LightGBM, Random Forest etc. or a customized learner.
automl.fit(X_train, y_train, task="classification", estimator_list=["lgbm"])
  1. You can embed FLAML in self-tuning software for just-in-time tuning with low latency & resource consumption.
automl.fit(X_train, y_train, task="regression", time_budget=60)

Installation

FLAML requires Python version >= 3.6. It can be installed from pip:

pip install flaml

To run the notebook example, install flaml with the [notebook] option:

pip install flaml[notebook]

Examples

A basic classification example.

from flaml import AutoML
from sklearn.datasets import load_iris
# Initialize the FLAML learner.
automl = AutoML()
# Provide configurations.
automl_settings = {
    "time_budget": 10,  # in seconds
    "metric": 'accuracy',
    "task": 'classification',
    "log_file_name": "test/iris.log",
}
X_train, y_train = load_iris(return_X_y=True)
# Train with labeled input data.
automl.fit(X_train=X_train, y_train=y_train,
                        **automl_settings)
# Predict
print(automl.predict_proba(X_train))
# Export the best model.
print(automl.model)

A basic regression example.

from flaml import AutoML
from sklearn.datasets import load_boston
# Initialize the FLAML learner.
automl = AutoML()
# Provide configurations.
automl_settings = {
    "time_budget": 10,  # in seconds
    "metric": 'r2',
    "task": 'regression',
    "log_file_name": "test/boston.log",
}
X_train, y_train = load_boston(return_X_y=True)
# Train with labeled input data.
automl.fit(X_train=X_train, y_train=y_train,
                        **automl_settings)
# Predict
print(automl.predict(X_train))
# Export the best model.
print(automl.model)

More examples: see the notebook

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Authors

  • Chi Wang
  • Qingyun Wu
  • Erkang Zhu

Contributors: Markus Weimer, Silu Huang, Haozhe Zhang, Alex Deng.

License

MIT License

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

FLAML-0.1.0.tar.gz (29.6 kB view details)

Uploaded Source

Built Distribution

FLAML-0.1.0-py3-none-any.whl (31.9 kB view details)

Uploaded Python 3

File details

Details for the file FLAML-0.1.0.tar.gz.

File metadata

  • Download URL: FLAML-0.1.0.tar.gz
  • Upload date:
  • Size: 29.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.7

File hashes

Hashes for FLAML-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d80c917cc0d520fd7392e030e3affb4d280807374607e7cd0f7593961c68f254
MD5 b54a9813311edd93924c8bb8054cd9e0
BLAKE2b-256 70c09e595180ee0391d406d0bba68943cdf033258e84723c23b19ac2c34a7570

See more details on using hashes here.

File details

Details for the file FLAML-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: FLAML-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 31.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.7

File hashes

Hashes for FLAML-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 66aa6ef012b07d3e57b98cc6ddabab0c96ed3f6cfbdf47dc3b3ebb3fe4b5b973
MD5 07f1c21110fc07541a01174a929f8a58
BLAKE2b-256 c0ce2cd541302f74b5767d367e90237470893c65bfb1db5734b02ae6fbcb049d

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