{"id":13932911,"url":"https://github.com/Freemanzxp/GBDT_Simple_Tutorial","last_synced_at":"2025-07-19T16:32:11.837Z","repository":{"id":49385376,"uuid":"179527902","full_name":"Freemanzxp/GBDT_Simple_Tutorial","owner":"Freemanzxp","description":"python实现GBDT的回归、二分类以及多分类，将算法流程详情进行展示解读并可视化，庖丁解牛地理解GBDT。Gradient Boosting Decision Trees regression, dichotomy and multi-classification are realized based on python, and the details of algorithm flow are displayed, interpreted and visualized to help readers better understand Gradient Boosting Decision Trees","archived":false,"fork":false,"pushed_at":"2019-06-15T06:33:32.000Z","size":2238,"stargazers_count":714,"open_issues_count":5,"forks_count":196,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-08-07T21:11:54.175Z","etag":null,"topics":["gbdt","gnm","gradient-boosting","gradient-boosting-decision-trees","machine-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Freemanzxp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-04T15:41:00.000Z","updated_at":"2024-08-01T02:33:12.000Z","dependencies_parsed_at":"2022-09-01T13:51:30.635Z","dependency_job_id":null,"html_url":"https://github.com/Freemanzxp/GBDT_Simple_Tutorial","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freemanzxp%2FGBDT_Simple_Tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freemanzxp%2FGBDT_Simple_Tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freemanzxp%2FGBDT_Simple_Tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freemanzxp%2FGBDT_Simple_Tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Freemanzxp","download_url":"https://codeload.github.com/Freemanzxp/GBDT_Simple_Tutorial/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226643822,"owners_count":17662967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gbdt","gnm","gradient-boosting","gradient-boosting-decision-trees","machine-learning"],"created_at":"2024-08-07T21:01:21.334Z","updated_at":"2024-11-26T23:30:47.414Z","avatar_url":"https://github.com/Freemanzxp.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# GBDT_Simple_Tutorial（梯度提升树简易教程）\n## 简介\n利用python实现GBDT算法的回归、二分类以及多分类，将算法流程详情进行展示解读并可视化，便于读者庖丁解牛地理解GBDT。\n\n## 项目进度：\n- [x] 回归 \n- [x] 二分类 \n- [x] 多分类\n- [x] 可视化 \n***\n**算法原理以及公式推导请前往blog：**[GBDT算法原理以及实例理解](https://blog.csdn.net/zpalyq110/article/details/79527653)\n***\n## 依赖环境\n- 操作系统：Windows/Linux\n- 编程语言：Python3\n- Python库：pandas、PIL、pydotplus，\n 其中pydotplus库会自动调用Graphviz，所以需要去[Graphviz官网](https://graphviz.gitlab.io/_pages/Download/Download_windows.html)下载`graphviz的-2.38.msi`\n，先安装，再将安装目录下的`bin`添加到系统环境变量，此时如果再报错可以重启计算机。详细过程不再描述，网上很多解答。\n\n## 文件结构\n- | - GBDT 主模块文件夹\n- | --- gbdt.py 梯度提升算法主框架\n- | --- decision_tree.py 单颗树生成，包括节点划分和叶子结点生成\n- | --- loss_function.py 损失函数\n- | --- tree_plot.py 树的可视化\n- | - example.py 回归/二分类/多分类测试文件\n\n\n## 运行指南\n- 回归测试：\n\n    `python example.py --model = regression`\n- 二分类测试：\n\n    `python example.py --model = binary_cf`\n- 多分类测试：\n\n    `python example.py --model = multi_cf`\n- 其他可配置参数：`lr` -- 学习率,   `trees` -- 构建的决策树数量即迭代次数,    \n`depth` -- 决策树的深度,   `count` -- 决策树节点分裂的最小数据数量,\n`is_log` -- 是否打印树的生成过程, `is_plot` -- 是否可视化树的结构.\n- 结果文件： 运行后会生成`results`文件夹,里面包含了每棵树的内部结构和生成日志\n\n\n## 结果展示\n仅展示最后所有树的集合，具体每棵树的详细信息望读者自行运行代码~\n\u003cimg src=\"https://github.com/Freemanzxp/GBDT_Simple_Tutorial/raw/master/展示图片/all_trees.png\"/\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFreemanzxp%2FGBDT_Simple_Tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFreemanzxp%2FGBDT_Simple_Tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFreemanzxp%2FGBDT_Simple_Tutorial/lists"}