FLAML

microsoftMIT活跃维护

轻量级自动机器学习库,能自动搜索模型和超参数,用较低算力快速找到不错的配置,适合分类、回归和调参场景。

A fast library for AutoML and tuning. Join our Discord: https://discord.gg/Cppx2vSPVP.

v2.8.0发布于 2026-11-06 07:01 UTC4,418star +1 / 7 天584fork同步于 2026-11-10 05:37 UTC

怎么上手

由 README 提炼,执行前请确认
pip install flaml
pip install "flaml[automl]"
硬件要求按 README 说明

README 未说明显存或 GPU 要求,仅说明需要 Python >= 3.10 且 < 3.14

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

微软开源的轻量 AutoML 与超参调优库,在有限算力下自动选模型并调参

轻量级自动机器学习库,能自动搜索模型和超参数,用较低算力快速找到不错的配置,适合分类、回归和调参场景。

核心能力

  • 三行代码以 scikit-learn 风格启动 AutoML
  • 在资源约束下自动完成模型选择与超参优化
  • 可限定 estimator_list 只调 LightGBM 等指定模型
  • tune.run 对自定义函数做通用超参搜索并支持时间预算
  • Zero-shot AutoML 按数据自动设定 LightGBM/XGBoost 超参

容易踩的坑

默认只装最小依赖,用 automl 模块需额外安装 flaml[automl];Python 版本需在 3.10 到 3.14 之间,否则完整模型支持不保证;autogen 模块已移出 FLAML,需改用独立的 AutoGen 仓库

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v2.8.0
  1. v2.8.0最新正式版2026-11-06 · 2026-11-06 07:01 UTC

    This release improves correctness across AutoML, forecasting, and tuning. It fixes quantized integer sampling bounds, singleton integer search-space normalization, low-cost search-space processing, and independence of suggested configurations from the portfolio. It strengthens time-series evaluation with corrected cross-validation coverage, panel time indices, naive and seasonal-naive forecasts, and R² scoring. Data preparation and metrics improvements include OrdinalEncoder-based categorical encoding, preservation of missing datetimes for imputation, weighted MAPE, clearer errors for binary-only metrics on multiclass data, and support for scalar ROUGE results. It also improves training-log appends and Spark forest prediction, updates pandas compatibility and Windows ARM64 CI, and refreshes documentation and dependencies.

    Thank you to all contributors for the PRs, issues, reviewing and testing.

    Welcome @raashish1601, @Linxiushen, @anishmehta24, @ktz03, @student-shivamm, @sarankumar1325, and @nicoloangileri to the community!

    What's Changed

  2. v2.7.02026-09-18 · 2026-09-18 05:31 UTC
    查看更新说明

    This release improves reproducibility and correctness across AutoML and tuning, including consistent random seed handling for SGD, logistic regression, random forest, and XGBoost, per-fold resampling for class imbalance, corrected quantized float sampling, per-metric trial averages, and preservation of zero-valued anonymous tuning metrics. It strengthens data preparation and evaluation with stable categorical encoding, aligned sample weights for non-shuffled and group splits, and free-memory propagation, while adding compatibility for recent scikit-learn and statsmodels changes. It corrects Statsmodels future forecast horizons and adds a Simplified Chinese README. It also adds Windows ARM64 CI, hardens GitHub Actions permissions and action pinning, and refreshes documentation and dependencies.

    Thank you to all contributors for the PRs, issues, reviewing and testing.

    Welcome @immu4989, @arpitjain099, @arushiiii18, @danfiedler-msft, @MeiSiristhebest, @AmirF194, @shoemoney, @VenishPaneliya, @nithin-aashik-mcw, @betacatsling, @wangyusheng1985, and @JasonYeYuhe to the community!

    What's Changed

  3. v2.6.02026-04-28 · 2026-04-28 02:02 UTC
    查看更新说明

    This release improves compatibility with the latest ecosystem packages, including scikit-learn 1.7+, Transformers 4.26+/5.0+, pandas 3.0, and recent setuptools changes. It strengthens packaging by unblocking editable installs and migrating metadata to PEP 621, fixes CatBoost and Optuna-related test issues, and adds timestamp generation for time series predictions without test data. It also includes website dependency updates, CI/deployment maintenance, and documentation updates for LightGBM quantile regression and supported Python versions.

    Welcome @OpenByteDev to the community!

    What's Changed

    New Contributors

    Full Changelog: https://github.com/microsoft/FLAML/compare/v2.5.0...v2.6.0

  4. v2.5.02026-01-21 · 2026-01-21 08:49 UTC
    查看更新说明

    This release adds Python 3.13 support, fixes several bugs in search, configuration handling, and estimator preprocessing, and improves overall robustness. It also includes major documentation updates covering metrics, estimators, best practices, and hierarchical search spaces. Most of the work was contributed by @Copilot.

    What's Changed

    Full Changelog: https://github.com/microsoft/FLAML/compare/v2.4.1...v2.5.0

  5. v2.4.12026-01-13 · 2026-01-13 04:57 UTC
    查看更新说明

    This release includes comprehensive documentation updates to reflect recent changes across the project, adds a new best practices page, introduces support for pickling the entire AutoML instance, and fixes several bugs.

    What's Changed

    Full Changelog: https://github.com/microsoft/FLAML/compare/v2.4.0...v2.4.1

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    PyPI version Conda version Build PyPI - Python Version Downloads

    A Fast Library for Automated Machine Learning & Tuning

    :fire: FLAML supports AutoML and Hyperparameter Tuning in Microsoft Fabric Data Science. In addition, we've introduced Python 3.11+ support, along with a range of new estimators, and comprehensive integration with MLflow—thanks to contributions from the Microsoft Fabric product team.

    :fire: Heads-up: AutoGen has moved to a dedicated GitHub repository. FLAML no longer includes the autogen module—please use AutoGen directly.

    What is FLAML

    FLAML is a lightweight Python library for efficient automation of machine learning and AI operations. It automates workflow based on large language models, machine learning models, etc. and optimizes their performance.

    • FLAML enables economical automation and tuning for ML/AI workflows, including model selection and hyperparameter optimization under resource constraints.
    • For common machine learning tasks like classification and regression, it quickly finds quality models for user-provided data with low computational resources. It is easy to customize or extend. Users can find their desired customizability from a smooth range.
    • It supports fast and economical automatic tuning (e.g., inference hyperparameters for foundation models, configurations in MLOps/LMOps workflows, pipelines, mathematical/statistical models, algorithms, computing experiments, software configurations), capable of handling large search space with heterogeneous evaluation cost and complex constraints/guidance/early stopping.

    FLAML is powered by a series of research studies from Microsoft Research and collaborators such as Penn State University, Stevens Institute of Technology, University of Washington, and University of Waterloo.

    FLAML has a .NET implementation in ML.NET, an open-source, cross-platform machine learning framework for .NET.

    Installation

    The latest version of FLAML requires Python >= 3.10 and < 3.14. While other Python versions may work for core components, full model support is not guaranteed. FLAML can be installed via pip:

    pip install flaml
    

    Minimal dependencies are installed without extra options. You can install extra options based on the feature you need. For example, use the following to install the dependencies needed by the automl module.

    pip install "flaml[automl]"
    

    Find more options in Installation. Each of the notebook examples may require a specific option to be installed.

    Quickstart

    from flaml import AutoML
    
    automl = AutoML()
    automl.fit(X_train, y_train, task="classification")
    
    • 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"])
    
    from flaml import tune
    
    tune.run(
        evaluation_function, config={...}, low_cost_partial_config={...}, time_budget_s=3600
    )
    
    • Zero-shot AutoML allows using the existing training API from lightgbm, xgboost etc. while getting the benefit of AutoML in choosing high-performance hyperparameter configurations per task.
    from flaml.default import LGBMRegressor
    
    # Use LGBMRegressor in the same way as you use lightgbm.LGBMRegressor.
    estimator = LGBMRegressor()
    # The hyperparameters are automatically set according to the training data.
    estimator.fit(X_train, y_train)
    

    Documentation

    You can find a detailed documentation about FLAML here.

    In addition, you can find:

    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.

    If you are new to GitHub here is a detailed help source on getting involved with development on GitHub.

    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 [email protected] with any additional questions or comments.

    Contributors Wall