lightgbm-org/LightGBM

GitHub: lightgbm-org/LightGBM

LightGBM 是一个高效、分布式的梯度提升决策树框架,旨在解决大规模数据建模中的速度与精度挑战。

Stars: 18580 | Forks: 4036

# Light Gradient Boosting Machine [![C++ GitHub Actions Build Status](https://static.pigsec.cn/wp-content/uploads/repos/cas/72/72695ebfb71d8b238d29dfd5d147e01231d4f78011bae271e5265621428bf21a.svg)](https://github.com/lightgbm-org/LightGBM/actions/workflows/cpp.yml) [![Python-package GitHub Actions Build Status](https://static.pigsec.cn/wp-content/uploads/repos/cas/e5/e5e4856cfc09d4979978cf4debef0d7d94597086299e4fbbb1f69f8cfe78360b.svg)](https://github.com/lightgbm-org/LightGBM/actions/workflows/python_package.yml) [![R-package GitHub Actions Build Status](https://static.pigsec.cn/wp-content/uploads/repos/cas/da/da5b12d60db2316f747880ee55b42ad46e56f24d3ae529dea46fb718f73fc7c2.svg)](https://github.com/lightgbm-org/LightGBM/actions/workflows/r_package.yml) [![CUDA Version GitHub Actions Build Status](https://static.pigsec.cn/wp-content/uploads/repos/cas/e0/e0e450b72e89d6858f57692369121fe47ee4a7e8872a7644db1e502a349a49a7.svg)](https://github.com/lightgbm-org/LightGBM/actions/workflows/cuda.yml) [![SWIG Wrapper GitHub Actions Build Status](https://static.pigsec.cn/wp-content/uploads/repos/cas/9d/9d564d424d068e9e8066fc25d555d7f61cee2d643dbc09f93548b47e0847a03e.svg)](https://github.com/lightgbm-org/LightGBM/actions/workflows/swig.yml) [![Static Analysis GitHub Actions Build Status](https://static.pigsec.cn/wp-content/uploads/repos/cas/9b/9b6dce43bb5af915a23a678b9d8aec909e6750b41507e6923c4ad9f366d280b9.svg)](https://github.com/lightgbm-org/LightGBM/actions/workflows/static_analysis.yml) [![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/1ys5ot401m0fep6l/branch/master?svg=true)](https://ci.appveyor.com/project/guolinke/lightgbm/branch/master) [![Documentation Status](https://readthedocs.org/projects/lightgbm/badge/?version=latest)](https://lightgbm.readthedocs.io/) [![Link checks](https://static.pigsec.cn/wp-content/uploads/repos/cas/1b/1bde97e977762b77cb6b27653f2804b91f84121068e1a6d481e6b0699a9fe196.svg)](https://github.com/lightgbm-org/LightGBM/actions/workflows/lychee.yml) [![License](https://img.shields.io/github/license/lightgbm-org/lightgbm.svg)](https://github.com/lightgbm-org/LightGBM/blob/master/LICENSE) [![EffVer Versioning](https://img.shields.io/badge/version_scheme-EffVer-0097a7)](https://jacobtomlinson.dev/effver) [![StackOverflow questions](https://img.shields.io/stackexchange/stackoverflow/t/lightgbm?logo=stackoverflow&logoColor=white&label=StackOverflow%20questions)](https://stackoverflow.com/questions/tagged/lightgbm?sort=votes) [![Python Versions](https://img.shields.io/pypi/pyversions/lightgbm.svg?logo=python&logoColor=white)](https://pypi.org/project/lightgbm) [![PyPI Version](https://img.shields.io/pypi/v/lightgbm.svg?logo=pypi&logoColor=white)](https://pypi.org/project/lightgbm) [![conda Version](https://img.shields.io/conda/vn/conda-forge/lightgbm?logo=conda-forge&logoColor=white&label=conda)](https://anaconda.org/conda-forge/lightgbm) [![CRAN Version](https://www.r-pkg.org/badges/version/lightgbm)](https://cran.r-project.org/package=lightgbm) [![NuGet Version](https://img.shields.io/nuget/v/lightgbm?logo=nuget&logoColor=white)](https://www.nuget.org/packages/LightGBM) [![Winget Version](https://img.shields.io/winget/v/Microsoft.LightGBM)](https://github.com/microsoft/winget-pkgs/tree/master/manifests/m/Microsoft/LightGBM) LightGBM 是一个使用基于树的学习算法的梯度提升框架。它被设计为分布式的,并且具有以下优势的高效性: - 更快的训练速度和更高的效率。 - 更低的内存使用。 - 更好的准确率。 - 支持并行、分布式和 GPU 学习。 - 能够处理大规模数据。 有关更多详细信息,请参阅[功能](https://github.com/lightgbm-org/LightGBM/blob/master/docs/Features.rst)。 得益于这些优势,LightGBM 在许多机器学习竞赛的[获胜方案](https://github.com/lightgbm-org/LightGBM/blob/master/examples/README.md#machine-learning-challenge-winning-solutions)中得到了广泛使用。 在公共数据集上的[对比实验](https://github.com/lightgbm-org/LightGBM/blob/master/docs/Experiments.rst#comparison-experiment)表明,LightGBM 在效率和准确率上都优于现有的提升框架,且内存消耗显著降低。此外,[分布式学习实验](https://github.com/lightgbm-org/LightGBM/blob/master/docs/Experiments.rst#parallel-experiment)表明,LightGBM 在特定设置下可以通过使用多台机器进行训练来实现线性加速。 ## 开始使用与文档 我们的主要文档位于 https://lightgbm.readthedocs.io/,并且是从该仓库生成的。如果您是 LightGBM 的新手,请按照该网站上的[安装说明](https://lightgbm.readthedocs.io/en/latest/Installation-Guide.html)进行操作。 接下来您可能想阅读: - [**示例**](https://github.com/lightgbm-org/LightGBM/tree/master/examples)展示了常见任务的命令行用法。 - LightGBM 支持的[**功能**](https://github.com/lightgbm-org/LightGBM/blob/master/docs/Features.rst)和算法。 - [**参数**](https://github.com/lightgbm-org/LightGBM/blob/master/docs/Parameters.rst)是您可以进行的详尽的自定义列表。 - [**分布式学习**](https://github.com/lightgbm-org/LightGBM/blob/master/docs/Parallel-Learning-Guide.rst)和[**GPU 学习**](https://github.com/lightgbm-org/LightGBM/blob/master/docs/GPU-Tutorial.rst)可以加快计算速度。 - [**FLAML**](https://www.microsoft.com/en-us/research/project/fast-and-lightweight-automl-for-large-scale-data/articles/flaml-a-fast-and-lightweight-automl-library/)为 LightGBM 提供自动化调优([代码示例](https://microsoft.github.io/FLAML/docs/Examples/AutoML-for-LightGBM/))。 - [**Optuna 超参数调优器**](https://medium.com/optuna/lightgbm-tuner-new-optuna-integration-for-hyperparameter-optimization-8b7095e99258)为 LightGBM 超参数提供自动化调优([代码示例](https://github.com/optuna/optuna-examples/blob/main/lightgbm/lightgbm_tuner_simple.py))。 - [**理解 LightGBM 参数(以及如何使用 Neptune 调整它们)**](https://neptune.ai/blog/lightgbm-parameters-guide)。 面向贡献者的文档: - [**我们如何更新 readthedocs.io**](https://github.com/lightgbm-org/LightGBM/blob/master/docs/README.rst)。 - 查看[**开发指南**](https://github.com/lightgbm-org/LightGBM/blob/master/docs/Development-Guide.rst)。 ## 新闻 请参阅 [GitHub releases](https://github.com/lightgbm-org/LightGBM/releases) 页面上的更新日志。 ## 外部(非官方)仓库 此处列出的项目提供了使用 LightGBM 的替代方法。 它们不由 `LightGBM` 开发团队维护或官方认可。 JPMML(Java PMML 转换器):https://github.com/jpmml/jpmml-lightgbm Nyoka(Python PMML 转换器):https://github.com/SoftwareAG/nyoka Treelite(用于高效部署的模型编译器):https://github.com/dmlc/treelite lleaves(基于 LLVM 的高效推理模型编译器):https://github.com/siboehm/lleaves Hummingbird(转换为张量计算的模型编译器):https://github.com/microsoft/hummingbird GBNet(将 `LightGBM` 作为 [PyTorch Module](https://docs.pytorch.org/docs/stable/generated/torch.nn.Module.html) 使用):https://github.com/mthorrell/gbnet cuML Forest Inference Library(GPU 加速推理):https://github.com/rapidsai/cuml nvForest(GPU 加速推理):https://github.com/rapidsai/nvforest daal4py(Intel CPU 加速推理):https://github.com/intel/scikit-learn-intelex/tree/master/daal4py m2cgen(适用于多种语言的模型应用器):https://github.com/BayesWitnesses/m2cgen leaves(Go 模型应用器):https://github.com/dmitryikh/leaves ONNXMLTools(ONNX 转换器):https://github.com/onnx/onnxmltools SHAP(模型输出解释器):https://github.com/slundberg/shap Shapash(模型可视化和解释):https://github.com/MAIF/shapash dtreeviz(决策树可视化和模型解释):https://github.com/parrt/dtreeviz supertree(决策树的交互式可视化):https://github.com/mljar/supertree SynapseML(Spark 上的 LightGBM):https://github.com/microsoft/SynapseML Kubeflow Fairing(Kubernetes 上的 LightGBM):https://github.com/kubeflow/fairing Kubeflow Operator(Kubernetes 上的 LightGBM):https://github.com/kubeflow/xgboost-operator lightgbm_ray(Ray 上的 LightGBM):https://github.com/ray-project/lightgbm_ray Ray(分布式计算框架):https://github.com/ray-project/ray Mars(Mars 上的 LightGBM):https://github.com/mars-project/mars ML.NET(.NET/C# 包):https://github.com/dotnet/machinelearning LightGBM.NET(.NET/C# 包):https://github.com/rca22/LightGBM.Net LightGBM Ruby(Ruby gem):https://github.com/ankane/lightgbm-ruby LightGBM4j(Java 高级绑定):https://github.com/metarank/lightgbm4j LightGBM4J(用 Scala 编写的 LightGBM 的 JVM 接口):https://github.com/seek-oss/lightgbm4j Julia-package:https://github.com/IQVIA-ML/LightGBM.jl lightgbm3(Rust 绑定):https://github.com/Mottl/lightgbm3-rs MLServer(LightGBM 的推理服务器):https://github.com/SeldonIO/MLServer MLflow(实验跟踪、模型监控框架):https://github.com/mlflow/mlflow FLAML(用于超参数优化的 AutoML 库):https://github.com/microsoft/FLAML MLJAR AutoML(表格数据上的 AutoML):https://github.com/mljar/mljar-supervised Optuna(超参数优化框架):https://github.com/optuna/optuna LightGBMLSS(使用 LightGBM 进行概率建模):https://github.com/StatMixedML/LightGBMLSS LightGBM-MoE(Mixture-of-Experts / 机制转换扩展):https://github.com/kyo219/LightGBM-MoE darts(使用 LightGBM 进行时间序列预测和异常检测):https://github.com/unit8co/darts mlforecast(使用 LightGBM 进行时间序列预测):https://github.com/Nixtla/mlforecast skforecast(使用 LightGBM 进行时间序列预测):https://github.com/JoaquinAmatRodrigo/skforecast `{bonsai}`(R `{parsnip}` 兼容接口):https://github.com/tidymodels/bonsai `{mlr3extralearners}`(R `{mlr3}` 兼容接口):https://github.com/mlr-org/mlr3extralearners lightgbm-transform(特征转换绑定):https://github.com/lightgbm-org/LightGBM-transform `postgresml`(通过 Postgres 扩展在 SQL 中进行 LightGBM 训练和预测):https://github.com/postgresml/postgresml `pyodide`(在 Web 浏览器中运行 `lightgbm` Python 包):https://github.com/pyodide/pyodide `vaex-ml`(带有自身 LightGBM 接口的 Python DataFrame 库):https://github.com/vaexio/vaex ## 支持 - [在 Stack Overflow 上使用 `lightgbm` 标签提问](https://stackoverflow.com/questions/ask?tags=lightgbm),我们会关注其中的新问题。 - 在 [GitHub issues](https://github.com/lightgbm-org/LightGBM/issues) 上提交**错误报告**和**功能请求**。 ## 微软开源行为准则 本项目采用了[微软开源行为准则](https://opensource.microsoft.com/codeofconduct/)。有关更多信息,请参阅[行为准则常见问题](https://opensource.microsoft.com/codeofconduct/faq/),如有任何其他问题或评论,请联系 [opencode@microsoft.com](mailto:opencode@microsoft.com)。 ## 参考论文 Yu Shi, Guolin Ke, Zhuoming Chen, Shuxin Zheng, Tie-Yan Liu. "Quantized Training of Gradient Boosting Decision Trees" ([链接](https://proceedings.neurips.cc/paper/2022/hash/77911ed9e6e864ca1a3d165b2c3cb258-Abstract.html)). Advances in Neural Information Processing Systems 35 (NeurIPS 2022), pp. 18822-18833. Guolin Ke, Qi Meng, Thomas Finley, Taifeng Wang, Wei Chen, Weidong Ma, Qiwei Ye, Tie-Yan Liu. "[LightGBM: A Highly Efficient Gradient Boosting Decision Tree](https://proceedings.neurips.cc/paper/2017/hash/6449f44a102fde848669bdd9eb6b76fa-Abstract.html)". Advances in Neural Information Processing Systems 30 (NIPS 2017), pp. 3149-3157. Qi Meng, Guolin Ke, Taifeng Wang, Wei Chen, Qiwei Ye, Zhi-Ming Ma, Tie-Yan Liu. "[A Communication-Efficient Parallel Algorithm for Decision Tree](https://proceedings.neurips.cc/paper/2016/hash/10a5ab2db37feedfdeaab192ead4ac0e-Abstract.html)". Advances in Neural Information Processing Systems 29 (NIPS 2016), pp. 1279-1287. Huan Zhang, Si Si and Cho-Jui Hsieh. "[GPU Acceleration for Large-scale Tree Boosting](https://arxiv.org/abs/1706.08359)". SysML Conference, 2018. ## 许可证 本项目根据 MIT 许可证的条款授权。有关更多详细信息,请参阅 [LICENSE](https://github.com/lightgbm-org/LightGBM/blob/master/LICENSE)。
标签:Apex, GBDT, 分类与回归, 机器学习, 梯度提升树, 算法框架