Software:XGBoost

From HandWiki
Short description: Gradient boosting machine learning library
XGBoost
XGBoost logo.png
Developer(s)The XGBoost Contributors
Initial releaseMarch 27, 2014; 9 years ago (2014-03-27)
Written inC++
Operating systemLinux, macOS, Microsoft Windows
TypeMachine learning
LicenseApache License 2.0
Websitexgboost.ai

XGBoost[1] (eXtreme Gradient Boosting) is an open-source software library which provides a regularizing gradient boosting framework for C++, Java, Python,[2] R,[3] Julia,[4] Perl,[5] and Scala. It works on Linux, Microsoft Windows,[6] and macOS.[7] From the project description, it aims to provide a "Scalable, Portable and Distributed Gradient Boosting (GBM, GBRT, GBDT) Library". It runs on a single machine, as well as the distributed processing frameworks Apache Hadoop, Apache Spark, Apache Flink, and Dask.[8][9]

XGBoost gained much popularity and attention in the mid-2010s as the algorithm of choice for many winning teams of machine learning competitions.[10]

History

XGBoost initially started as a research project by Tianqi Chen[11] as part of the Distributed (Deep) Machine Learning Community (DMLC) group. Initially, it began as a terminal application which could be configured using a libsvm configuration file. It became well known in the ML competition circles after its use in the winning solution of the Higgs Machine Learning Challenge. Soon after, the Python and R packages were built, and XGBoost now has package implementations for Java, Scala, Julia, Perl, and other languages. This brought the library to more developers and contributed to its popularity among the Kaggle community, where it has been used for a large number of competitions.[10]

It was soon integrated with a number of other packages making it easier to use in their respective communities. It has now been integrated with scikit-learn for Python users and with the caret package for R users. It can also be integrated into Data Flow frameworks like Apache Spark, Apache Hadoop, and Apache Flink using the abstracted Rabit[12] and XGBoost4J.[13] XGBoost is also available on OpenCL for FPGAs.[14] An efficient, scalable implementation of XGBoost has been published by Tianqi Chen and Carlos Guestrin.[15]

While the XGBoost model often achieves higher accuracy than a single decision tree, it sacrifices the intrinsic interpretability of decision trees.  For example, following the path that a decision tree takes to make its decision is trivial and self-explained, but following the paths of hundreds or thousands of trees is much harder. To achieve both performance and interpretability, some model compression techniques allow transforming an XGBoost into a single "born-again" decision tree that approximates the same decision function.[16]

Features

Salient features of XGBoost which make it different from other gradient boosting algorithms include:[17][18][19][15]

  • Clever penalization of trees
  • A proportional shrinking of leaf nodes
  • Newton Boosting
  • Extra randomization parameter
  • Implementation on single, distributed systems and out-of-core computation
  • Automatic Feature selection [citation needed]
  • Theoretically justified weighted quantile sketching for efficient computation
  • Parallel tree structure boosting with sparsity
  • Efficient cacheable block structure for decision tree training

The algorithm

XGBoost works as Newton-Raphson in function space unlike gradient boosting that works as gradient descent in function space, a second order Taylor approximation is used in the loss function to make the connection to Newton Raphson method.

A generic unregularized XGBoost algorithm is:

Input: training set [math]\displaystyle{ \{(x_i, y_i)\}_{i=1}^N }[/math], a differentiable loss function [math]\displaystyle{ L(y, F(x)) }[/math], a number of weak learners [math]\displaystyle{ M }[/math] and a learning rate [math]\displaystyle{ \alpha }[/math].

Algorithm:

  1. Initialize model with a constant value:
    [math]\displaystyle{ \hat{f}_{(0)}(x) = \underset{\theta}{\arg\min} \sum_{i=1}^N L(y_i, \theta). }[/math]
  2. For m = 1 to M:
    1. Compute the 'gradients' and 'hessians':
      [math]\displaystyle{ \hat{g}_m(x_i)=\left[\frac{\partial L(y_i,f(x_i))}{\partial f(x_i)} \right]_{f(x)=\hat{f}_{(m-1)}(x)}. }[/math]
      [math]\displaystyle{ \hat{h}_m(x_i)=\left[\frac{\partial^2 L(y_i,f(x_i))}{\partial f(x_i)^2} \right]_{f(x)=\hat{f}_{(m-1)}(x)}. }[/math]
    2. Fit a base learner (or weak learner, e.g. tree) using the training set [math]\displaystyle{ \displaystyle\left\{x_i,-\frac{\hat{g}_m(x_i)}{\hat{h}_m(x_i)}\right\}_{i=1}^{N} }[/math] by solving the optimization problem below:
      [math]\displaystyle{ \hat{\phi}_m=\underset{\phi \in \mathbf{\Phi}}{\arg\min}\sum_{i=1}^{N}\frac{1}{2}\hat{h}_m(x_i)\left[\phi(x_i) - \frac{\hat{g}_m(x_i)}{\hat{h}_m(x_i)}\right]^2. }[/math]
      [math]\displaystyle{ \hat{f}_m(x)=\alpha \hat{\phi}_m(x). }[/math]
    3. Update the model:
      [math]\displaystyle{ \hat{f}_{(m)}(x) = \hat{f}_{(m-1)}(x) + \hat{f}_m(x). }[/math]
  3. Output [math]\displaystyle{ \hat{f}(x)=\hat{f}_{(M)}(x)=\sum_{m=0}^{M}\hat{f}_m(x). }[/math]

Awards

  • John Chambers Award (2016)[20]
  • High Energy Physics meets Machine Learning award (HEP meets ML) (2016)[21]

See also

References

  1. "GitHub project webpage". June 2022. https://github.com/dmlc/xgboost. 
  2. "Python Package Index PYPI: xgboost". https://pypi.python.org/pypi/xgboost/. 
  3. "CRAN package xgboost". https://cran.r-project.org/web/packages/xgboost/index.html. 
  4. "Julia package listing xgboost". http://pkg.julialang.org/?pkg=XGBoost#XGBoost. 
  5. "CPAN module AI::XGBoost". https://metacpan.org/pod/AI::XGBoost. 
  6. "Installing XGBoost for Anaconda in Windows". https://www.ibm.com/developerworks/community/blogs/jfp/entry/Installing_XGBoost_For_Anaconda_on_Windows?lang=en. 
  7. "Installing XGBoost on Mac OSX". https://www.ibm.com/developerworks/community/blogs/jfp/entry/Installing_XGBoost_on_Mac_OSX?lang=en. 
  8. "Dask Homepage". https://www.dask.org/. 
  9. "Distributed XGBoost with Dask — xgboost 1.5.0-dev documentation". https://xgboost.readthedocs.io/en/latest/tutorials/dask.html. 
  10. 10.0 10.1 "XGBoost - ML winning solutions (incomplete list)". https://github.com/dmlc/xgboost/tree/master/demo#machine-learning-challenge-winning-solutions. 
  11. "Story and Lessons behind the evolution of XGBoost". http://homes.cs.washington.edu/~tqchen/2016/03/10/story-and-lessons-behind-the-evolution-of-xgboost.html. 
  12. "Rabit - Reliable Allreduce and Broadcast Interface". https://github.com/dmlc/rabit. 
  13. "XGBoost4J". https://xgboost.readthedocs.io/en/latest/jvm/index.html. 
  14. "XGBoost on FPGAs". https://github.com/InAccel/xgboost. 
  15. 15.0 15.1 Chen, Tianqi; Guestrin, Carlos (2016). "Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA, August 13-17, 2016". in Krishnapuram, Balaji; Shah, Mohak; Smola, Alexander J. et al.. ACM. pp. 785–794. doi:10.1145/2939672.2939785. ISBN 9781450342322. 
  16. Sagi, Omer; Rokach, Lior (2021). "Approximating XGBoost with an interpretable decision tree.". Information Sciences 572 (2021): 522-542. doi:10.1016/j.ins.2021.05.055. 
  17. Gandhi, Rohith (2019-05-24). "Gradient Boosting and XGBoost" (in en). https://medium.com/hackernoon/gradient-boosting-and-xgboost-90862daa6c77. 
  18. "Boosting algorithm: XGBoost" (in en). 2017-05-14. https://towardsdatascience.com/boosting-algorithm-xgboost-4d9ec0207d. 
  19. "Tree Boosting With XGBoost – Why Does XGBoost Win "Every" Machine Learning Competition?" (in en-US). 2017-10-22. https://syncedreview.com/2017/10/22/tree-boosting-with-xgboost-why-does-xgboost-win-every-machine-learning-competition/. 
  20. "John Chambers Award Previous Winners". http://stat-computing.org/awards/jmc/winners.html. 
  21. "HEP meets ML Award". https://higgsml.lal.in2p3.fr/prizes-and-award/award/.