XGBoost

From testwiki
Revision as of 10:06, 30 January 2025 by imported>Black eagle 333 (Try to answer to the request for clarification for the inizialization of f_0)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Short description Template:Infobox software 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

XG Boost 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.

Features

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

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: Template:Framebox Input: training set {(xi,yi)}i=1N, a differentiable loss function L(y,F(x)), a number of weak learners M and a learning rate α.

Algorithm:

  • Initialize model with a constant value: f^(0)(x)=argminθi=1NL(yi,θ).Template:Explain
Note that this is the initialization of the model and therefore we set a constant value for all inputs. So even if in later iterations we use optimization to find new functions, in step 0 we have to find the value, equals for all inputs, that minimizes the loss functions.
  1. For Template:Mvar = 1 to Template:Mvar:
    1. Compute the 'gradients' and 'hessians':Template:Clarify g^m(xi)=[L(yi,f(xi))f(xi)]f(x)=f^(m1)(x).h^m(xi)=[2L(yi,f(xi))f(xi)2]f(x)=f^(m1)(x).
    2. Fit a base learner (or weak learner, e.g. tree) using the training set {xi,g^m(xi)h^m(xi)}i=1NTemplate:Clarify by solving the optimization problem below: ϕ^m=argminϕΦi=1N12h^m(xi)[ϕ(xi)g^m(xi)h^m(xi)]2.Template:Clarify f^m(x)=αϕ^m(x).
    3. Update the model: f^(m)(x)=f^(m1)(x)f^m(x).
  2. Output f^(x)=f^(M)(x)=m=0Mf^m(x).

Template:Frame-footer

Awards

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

See also

References

Template:Reflist