XGBoost

XGBoost
開発元 The XGBoost Contributors
初版 2014年3月27日 (10年前) (2014-03-27)
最新版
2.0.3[1] ウィキデータを編集 / 2023年12月19日 (4か月前)
リポジトリ
  • github.com/dmlc/xgboost
ウィキデータを編集
プログラミング
言語
C++
対応OS
種別 機械学習
ライセンス Apache License 2.0
公式サイト xgboost.ai ウィキデータを編集
テンプレートを表示

XGBoost[2]は、 C++JavaPython[3]R[4]、Julia[5]Perl [6]Scala用の正則化勾配ブースティングフレームワークを提供するオープンソースソフトウェアライブラリ。 LinuxWindows[7]macOSで動作する[8]。 プロジェクトの説明によると、「スケーラブルでポータブルな分散型勾配ブースティング(GBM、GBRT、GBDT)ライブラリ」を提供することを目的としている。 単一のマシンだけでなく、分散処理フレームワークであるApache HadoopApache Spark、Apache Flink、Daskでも動作する[9][10]

機械学習コンテストの優勝チームの多くが選択するアルゴリズムとして、人気と注目を集めている[11]

同様に勾配ブースティングに基づくアルゴリズムとして、LightGBMCatBoostが存在する。

歴史

XGBoostは、Distrubuted (Deep) Machine Learning Community (DMLC) グループの一員であるTianqi Chen氏の研究プロジェクトとしてスタートした[12]。当初は、libsvmの設定ファイルで設定可能なターミナル・アプリケーションだった。 Higgs Machine Learning Challenge で優勝した際に使用されたことで、機械学習コンテストの世界で広く知られるようになった。その後すぐにPythonとRのパッケージが作られ、JavaScala、Julia、Perl、その他の言語のパッケージ実装ができた。これにより、XGBoost はより多くの開発者に利用されるようになり、Kaggleコミュニティでも人気を博し、多くのコンペティションで利用されている[11]

すぐに他の多くのパッケージと統合され、それぞれのコミュニティでの使用が容易になった。 Pythonユーザーにはscikit-learnRユーザーにはcaretパッケージと統合された。 また、抽象化されたRabit[13]とXGBoost4Jを使って、Apache SparkApache Hadoop、Apache FLINK[14] などのデータフローフレームワークに統合することもできる。XGBoostは、OpenCL for FPGAでも利用できる[15] 。 XGBoostの効率的でスケーラブルな実装は、Tianqi ChenとCarlos Guestrinによって発表された[16]

特徴

XGBoostは、他の勾配ブースティングアルゴリズムとは異なる、以下の様な特徴を持っている[17][18][19]

  • 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

アルゴリズム

XGBoostは、関数空間でニュートンラフソンとして動作する。関数空間で勾配降下法として機能する勾配ブースティングとは異なり、損失関数に2次テイラー近似を使用してニュートンラフソン法との関連性を持たせている。

一般的な非正則化 XGBoost アルゴリズムは次の通り。

Input: training set { ( x i , y i ) } i = 1 N {\displaystyle \{(x_{i},y_{i})\}_{i=1}^{N}} , a differentiable loss function L ( y , F ( x ) ) {\displaystyle L(y,F(x))} , a number of weak learners M {\displaystyle M} and a learning rate α {\displaystyle \alpha } .

Algorithm:

  1. Initialize model with a constant value:
    f ^ ( 0 ) ( x ) = arg min θ i = 1 N L ( y i , θ ) . {\displaystyle {\hat {f}}_{(0)}(x)={\underset {\theta }{\arg \min }}\sum _{i=1}^{N}L(y_{i},\theta ).}
  2. For m = 1 to M:
    1. Compute the 'gradients' and 'hessians':
      g ^ m ( x i ) = [ L ( y i , f ( x i ) ) f ( x i ) ] f ( x ) = f ^ ( m 1 ) ( x ) . {\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)}.}
      h ^ m ( x i ) = [ 2 L ( y i , f ( x i ) ) f ( x i ) 2 ] f ( x ) = f ^ ( m 1 ) ( x ) . {\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)}.}
    2. Fit a base learner (or weak learner, e.g. tree) using the training set { x i , g ^ m ( x i ) h ^ m ( x i ) } i = 1 N {\displaystyle \displaystyle \{x_{i},-{\frac {{\hat {g}}_{m}(x_{i})}{{\hat {h}}_{m}(x_{i})}}\}_{i=1}^{N}} by solving the optimization problem below:
      ϕ ^ m = arg min ϕ Φ i = 1 N 1 2 h ^ m ( x i ) [ g ^ m ( x i ) h ^ m ( x i ) ϕ ( x i ) ] 2 . {\displaystyle {\hat {\phi }}_{m}={\underset {\phi \in \mathbf {\Phi } }{\arg \min }}\sum _{i=1}^{N}{\frac {1}{2}}{\hat {h}}_{m}(x_{i})\left[-{\frac {{\hat {g}}_{m}(x_{i})}{{\hat {h}}_{m}(x_{i})}}-\phi (x_{i})\right]^{2}.}
      f ^ m ( x ) = α ϕ ^ m ( x ) . {\displaystyle {\hat {f}}_{m}(x)=\alpha {\hat {\phi }}_{m}(x).}
    3. Update the model:
      f ^ ( m ) ( x ) = f ^ ( m 1 ) ( x ) + f ^ m ( x ) . {\displaystyle {\hat {f}}_{(m)}(x)={\hat {f}}_{(m-1)}(x)+{\hat {f}}_{m}(x).}
  3. Output f ^ ( x ) = f ^ ( M ) ( x ) = m = 0 M f ^ m ( x ) . {\displaystyle {\hat {f}}(x)={\hat {f}}_{(M)}(x)=\sum _{m=0}^{M}{\hat {f}}_{m}(x).}

2006年
  • ジョン・チェンバース賞[20]
  • High Energy Physics Meets Machine Learning Award(HEP Meets ML[21]

関連項目

脚注

  1. ^ “Release 2.0.3” (19 12月 2023). 19 12月 2023閲覧。
  2. ^ “GitHub project webpage”. 2021年10月6日閲覧。
  3. ^ “Python Package Index PYPI: xgboost”. 2016年8月1日閲覧。
  4. ^ “CRAN package xgboost”. 2016年8月1日閲覧。
  5. ^ “Julia package listing xgboost”. 2016年8月1日閲覧。
  6. ^ “CPAN module AI::XGBoost”. 2020年2月9日閲覧。
  7. ^ “Installing XGBoost for Anaconda in Windows”. 2016年8月1日閲覧。
  8. ^ “Installing XGBoost on Mac OSX”. 2016年8月1日閲覧。
  9. ^ “Dask Homepage”. 2021年10月6日閲覧。
  10. ^ “Distributed XGBoost with Dask — xgboost 1.5.0-dev documentation”. xgboost.readthedocs.io. 2021年7月15日閲覧。
  11. ^ a b “XGBoost - ML winning solutions (incomplete list)”. 2016年8月1日閲覧。
  12. ^ “Story and Lessons behind the evolution of XGBoost”. 2016年8月1日閲覧。
  13. ^ “Rabit - Reliable Allreduce and Broadcast Interface”. 2016年8月1日閲覧。
  14. ^ “XGBoost4J”. 2016年8月1日閲覧。
  15. ^ “XGBoost on FPGAs”. 2019年8月1日閲覧。
  16. ^ Chen, Tianqi; Guestrin, Carlos (13 August 2016). Krishnapuram, Balaji; Shah, Mohak; Smola, Alexander J.; Aggarwal, Charu C. (eds.). XGBoost: A Scalable Tree Boosting System. the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. San Francisco, California, USA: Association for Computing Machinery. pp. 785–794. doi:10.1145/2939672.2939785。
  17. ^ Gandhi (2019年5月24日). “Gradient Boosting and XGBoost” (英語). Medium. 2020年1月4日閲覧。
  18. ^ “Boosting algorithm: XGBoost” (英語). Towards Data Science (2017年5月14日). 2020年1月4日閲覧。
  19. ^ “Tree Boosting With XGBoost – Why Does XGBoost Win "Every" Machine Learning Competition?” (英語). Synced (2017年10月22日). 2020年1月4日閲覧。
  20. ^ “John Chambers Award Previous Winners”. 2016年8月1日閲覧。
  21. ^ “HEP meets ML Award”. 2016年8月1日閲覧。

外部リンク

  • 公式ウェブサイト
  • xgboost - GitHub
  • XGBoost Documentation