ML之XGBoost:《Mastering XGBoost Parameter Tuning: A Complete Guide with Python Codes—掌握XGBoost参数调优》翻译与

505 篇文章 117 订阅

ML之XGBoost:《Mastering XGBoost Parameter Tuning: A Complete Guide with Python Codes—掌握XGBoost参数调优》翻译与解读(一)

目录

相关文章

其它网友优秀的翻译文章

XGBoost参数调优完全指南(附Python代码)

XGBoost参数调优的优秀外文翻译—《XGBoost中的参数调优完整指南(带python中的代码)》

概述/Overview

介绍/Introduction

你应该知道什么/What should you know ?

目录/Table of Contents

1. xgboost的优势/The XGBoost Advantage


相关文章
ML之XGBoost:XGBoost算法模型(相关配图)的简介(XGBoost并行处理)、关键思路、代码实现(目标函数/评价函数)、安装、使用方法、案例应用之详细攻略
ML之XGBoost:Kaggle神器XGBoost算法模型的简介(资源)、安装、使用方法、案例应用之详细攻略
ML之XGBoost:XGBoost参数调优的优秀外文翻译—《XGBoost中的参数调优完整指南(带python中的代码)》(一)
ML之XGBoost:XGBoost参数调优的优秀外文翻译—《XGBoost中的参数调优完整指南(带python中的代码)》(二)
ML之XGBoost:XGBoost参数调优的优秀外文翻译—《XGBoost中的参数调优完整指南(带python中的代码)》(三)
ML之XGBoost:XGBoost参数调优的优秀外文翻译—《XGBoost中的参数调优完整指南(带python中的代码)》(四)

相关文章

其它网友优秀的翻译文章

XGBoost参数调优完全指南(附Python代码)

XGBoost参数调优完全指南(附Python代码)-CSDN博客

XGBoost参数调优的优秀外文翻译—《XGBoost中的参数调优完整指南(带python中的代码)》

地址

文章地址:https://www.analyticsvidhya.com/blog/2016/03/complete-guide-parameter-tuning-xgboost-with-codes-python/

时间

更新于2023年10月25日

作者

Aarshay Jain

总结

主要介绍如何对XGBoost模型进行参数调优,总结如下:

>> XGBoost 参数分为三类:

常规参数:控制整体功能

Booster参数:控制每个提升器(树/回归)

学习任务参数:控制优化目标和评估标准

>> XGBoost 调优流程:

设定学习率和决策树数量

调优决策树相关参数(max_depth、min_child_weight等)

调优正则化参数(lambda、alpha)以降低复杂度

降低学习率,增加决策树数量

>> 使用modelfit函数自动进行交叉验证,确定优化后的决策树数量

>> 通过网格搜索(GridSearchCV)逐步调优每个参数,获取最优值

>> 提供了参数调优示例代码,详细介绍了各参数的含义和调优流程

>> 调优能明显提升模型效果,但增加特征工程和集成学习效果会更好

总之,这篇文章系统地介绍了XGBoost的参数分类,提供了参数调优的模板代码和具体步骤,给读者提供了一个从理论到实践的完整学习流程。

概述/Overview

  • XGBoost is a powerful machine learning algorithm especially where speed and accuracy are concerned
  • We need to consider different parameters and their values to be specified while implementing an XGBoost model
  • The XGBoost model requires parameter tuning to improve and fully leverage its advantages over other algorithms

--------------------------------------------------------------------------------------------------------------------------------------

  • xgboost是一种强大的机器学习算法,特别是在速度和精度方面。
  • 在实现XGBoost模型时,我们需要考虑不同的参数及其要被确定的数值。
  • xgboost模型需要参数调整,以改进和充分利用其相对于其他算法的优势。

介绍/Introduction

If things don’t go your way in predictive modeling, use XGboost.  XGBoost algorithm has become the ultimate weapon of many data scientist. It’s a highly sophisticated algorithm, powerful enough to deal with all sorts of irregularities of data.
如果在预测建模中事情不太成功,那么使用xgboost。xgboost算法已经成为许多数据科学家的终极武器。这是一种高度复杂的算法,其强大程度足以处理各种不规则的数据。

Building a model using XGBoost is easy. But, improving the model using XGBoost is difficult (at least I struggled a lot). This algorithm uses multiple parameters. To improve the model, parameter tuning is must. It is very difficult to get answers to practical questions like – Which set of parameters you should tune ? What is the ideal value of these parameters to obtain optimal output ?
使用xgboost构建模型很容易。但是,使用xgboost改进模型是困难的(至少我努力做了很多)。该算法使用多个参数。为了改进模型,必须对参数进行调整。很难找到实际问题的答案,比如你应该调整哪些参数?为了获得最佳输出,这些参数的理想值是多少?

This article is best suited to people who are new to XGBoost. In this article, we’ll learn the art of parameter tuning along with some useful information about XGBoost. Also, we’ll practice this algorithm using a  data set in Python.
这篇文章最适合刚接触XGBoost的人。在本文中,我们将学习参数调优的艺术,以及一些有关xgboost的有用信息。另外,我们将使用Python中的数据集来实践此算法。

你应该知道什么/What should you know ?

XGBoost (eXtreme Gradient Boosting) is an advanced implementation of gradient boosting algorithm. Since I covered Gradient Boosting Machine in detail in my previous article – Complete Guide to Parameter Tuning in Gradient Boosting (GBM) in Python, I highly recommend going through that before reading further. It will help you bolster your understanding of boosting in general and parameter tuning for GBM.
xgboost(极端梯度增强)是梯度增强算法的高级实现。由于我在上一篇文章–《 Complete Guide to Parameter Tuning in Gradient Boosting (GBM) in Python( python中的GBM参数微调的完整指南))》中详细介绍了渐变增强机器,所以我强烈建议在进一步阅读之前仔细阅读。它将帮助您增强对GBM一般增强和参数调整的理解。

Special Thanks: Personally, I would like to acknowledge the timeless support provided by Mr. Sudalai Rajkumar (aka SRK), currently AV Rank 2. This article wouldn’t be possible without his help. He is helping us guide thousands of data scientists. A big thanks to SRK!
特别感谢:个人角度,我想感谢Sudalai Rajkumar(aka SRK)先生提供的一直以来的支持,目前AV排名2。没有他的帮助,这篇文章是不可能的。他正在帮助我们指导成千上万的数据科学家。非常感谢SRK!

目录/Table of Contents

  1. The XGBoost Advantage
  2. Understanding XGBoost Parameters
  3. Tuning Parameters (with Example)

--------------------------------------------------------------------------------------------------------------------------------------

  1. xgboost的优势
  2. 了解xgboost参数
  3. 调谐参数(举例)

1. xgboost的优势/The XGBoost Advantage

I’ve always admired the boosting capabilities that this algorithm infuses in a predictive model. When I explored more about its performance and science behind its high accuracy, I discovered many advantages:
我一直欣赏这种算法在预测模型中注入的增强功能。当我更多地了解它的高精度背后的性能和科学性时,我发现了许多优势:

  1. 正则化/Regularization:
    • Standard GBM implementation has no regularization like XGBoost, therefore it also helps to reduce overfitting.
      标准的GBM实现没有像XGBoost那样的规范化,因此它也有助于减少过拟合。
    • In fact, XGBoost is also known as ‘regularized boosting‘ technique.
      事实上,xgboost也被称为“规则化增压”技术。
  2. 并行处理/Parallel Processing:
    • XGBoost implements parallel processing and is blazingly faster as compared to GBM.
      XGBoost实现了并行处理,与GBM相比速度快得惊人。
    • But hang on, we know that boosting is sequential process so how can it be parallelized? We know that each tree can be built only after the previous one, so what stops us from making a tree using all cores? I hope you get where I’m coming from. Check this link out to explore further.
      但是仔细一想,我们知道提升是一个连续的过程,所以它如何被并行化呢?我们知道每棵树只能在前一棵树之后才能被建造,那么是什么阻止了我们用所有的核心来建造一棵树呢?我希望你知道我从哪里来。请查看此链接以进一步了解。
    • XGBoost also supports implementation on Hadoop.
      XGBoost还支持Hadoop上的实现。
  3. 高灵活性/High Flexibility
    • XGBoost allow users to define custom optimization objectives and evaluation criteria.
      xgboost允许用户定义自定义优化目标和评估标准。
    • This adds a whole new dimension to the model and there is no limit to what we can do.
      这为模型增加了一个全新的维度,我们所能做的没有限制。
  4. 处理缺少的值/Handling Missing Values
    • XGBoost has an in-built routine to handle missing values.
      XGBoost有一个内置的例程来处理丢失的值。
    • User is required to supply a different value than other observations and pass that as a parameter. XGBoost tries different things as it encounters a missing value on each node and learns which path to take for missing values in future.
      用户需要提供与其他观察值不同的值,并将其作为参数传递。XGBoost尝试不同的方法,因为它在每个节点上遇到一个缺少值的情况,并了解将来要为缺少值采取什么路径。
  5. 树木修剪/Tree Pruning:
    • A GBM would stop splitting a node when it encounters a negative loss in the split. Thus it is more of a greedy algorithm.
      当一个GBM在分割中遇到负损失时,它将停止分割一个节点。因此,它更像是一个贪婪的算法。
    • XGBoost on the other hand make splits upto the max_depth specified and then start pruning the tree backwards and remove splits beyond which there is no positive gain.
      另一方面,xgboost将拆分到指定的最大深度,然后开始向后修剪树,删除没有正增益的拆分。
    • Another advantage is that sometimes a split of negative loss say -2 may be followed by a split of positive loss +10. GBM would stop as it encounters -2. But XGBoost will go deeper and it will see a combined effect of +8 of the split and keep both.
      另一个好处是有时负损失的分割,比如-2,然后正损失的分割+10。GBM遇到-2时会停止。但是xgboost会更深入,它会看到拆分的+8的组合效果,并保持两者。
  6. 内置交叉验证/Built-in Cross-Validation
    • XGBoost allows user to run a cross-validation at each iteration of the boosting process and thus it is easy to get the exact optimum number of boosting iterations in a single run.
      XGBoost允许用户在每次提升过程迭代时运行交叉验证,因此很容易在一次运行中获得准确的最佳提升迭代次数。
    • This is unlike GBM where we have to run a grid-search and only a limited values can be tested.
      这与GBM不同,我们必须运行网格搜索,并且只能测试有限的值。
  7. 支撑现有的模型/Continue on Existing Model
    • User can start training an XGBoost model from its last iteration of previous run. This can be of significant advantage in certain specific applications.
      用户可以从上次运行的迭代开始训练xgboost模型。在某些特定的应用中,这可能具有显著的优势。
    • GBM implementation of sklearn also has this feature so they are even on this point.
      sklearn的gbm实现也有这个特性,所以它们在这一点上更平稳。

I hope now you understand the sheer power XGBoost algorithm. Note that these are the points which I could muster. You know a few more? Feel free to drop a comment below and I will update the list.
我希望您现在能够理解XGBoost算法的强大功能。请注意,这些是我可以收集的要点。你知道更多吗?请随意在下面添加评论,我将更新列表。

Did I whet your appetite ? Good. You can refer to following web-pages for a deeper understanding:
我有没有激起你的食欲?很好。您可以参考以下网页以进一步了解:

  • 6
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

一个处女座的程序猿

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值