2015-08-01 11:27:13 -07:00
Python API Reference
====================
2021-05-11 06:44:36 -06:00
This page gives the Python API reference of xgboost, please also refer to Python Package Introduction for more information about the Python package.
2015-08-01 13:47:41 -07:00
2018-08-22 18:59:30 -07:00
.. contents ::
:backlinks: none
:local:
2020-12-03 00:05:18 -08:00
Global Configuration
--------------------
.. autofunction :: xgboost.config_context
.. autofunction :: xgboost.set_config
.. autofunction :: xgboost.get_config
2024-07-10 04:05:20 +08:00
.. autofunction :: xgboost.build_info
2015-08-01 11:27:13 -07:00
Core Data Structure
-------------------
.. automodule :: xgboost.core
.. autoclass :: xgboost.DMatrix
:members:
:show-inheritance:
2022-08-02 15:51:23 +08:00
.. autoclass :: xgboost.QuantileDMatrix
2023-08-10 00:40:06 +08:00
:members:
2024-09-24 06:19:28 +08:00
:inherited-members:
:show-inheritance:
.. autoclass :: xgboost.ExtMemQuantileDMatrix
:members:
:inherited-members:
2022-08-02 15:51:23 +08:00
:show-inheritance:
2015-08-01 11:27:13 -07:00
.. autoclass :: xgboost.Booster
:members:
:show-inheritance:
2024-12-06 16:48:17 +08:00
:special-members: __getitem__
2015-08-01 11:27:13 -07:00
2023-08-10 00:40:06 +08:00
.. autoclass :: xgboost.DataIter
:members:
:show-inheritance:
2015-08-01 11:27:13 -07:00
2025-08-01 04:56:52 +08:00
.. autoclass :: xgboost.core.Categories
2015-08-01 11:27:13 -07:00
Learning API
------------
.. automodule :: xgboost.training
.. autofunction :: xgboost.train
.. autofunction :: xgboost.cv
Scikit-Learn API
----------------
2023-03-23 13:30:42 +08:00
2015-08-01 11:27:13 -07:00
.. automodule :: xgboost.sklearn
.. autoclass :: xgboost.XGBRegressor
:members:
2018-08-22 18:59:30 -07:00
:inherited-members:
2015-08-01 11:27:13 -07:00
:show-inheritance:
.. autoclass :: xgboost.XGBClassifier
:members:
2018-08-22 18:59:30 -07:00
:inherited-members:
:show-inheritance:
.. autoclass :: xgboost.XGBRanker
:members:
:inherited-members:
2015-08-01 11:27:13 -07:00
:show-inheritance:
2019-05-25 18:30:24 +12:00
.. autoclass :: xgboost.XGBRFRegressor
:members:
:inherited-members:
:show-inheritance:
.. autoclass :: xgboost.XGBRFClassifier
:members:
:inherited-members:
:show-inheritance:
2015-08-11 16:40:09 +09:00
Plotting API
------------
.. automodule :: xgboost.plotting
.. autofunction :: xgboost.plot_importance
.. autofunction :: xgboost.plot_tree
.. autofunction :: xgboost.to_graphviz
2018-09-07 23:51:26 +03:00
.. _callback_api:
Callback API
------------
2022-01-05 03:21:25 +08:00
.. automodule :: xgboost.callback
.. autoclass :: xgboost.callback.TrainingCallback
:members:
2018-09-07 23:51:26 +03:00
2022-01-05 03:21:25 +08:00
.. autoclass :: xgboost.callback.EvaluationMonitor
:members:
:show-inheritance:
2018-09-07 23:51:26 +03:00
2022-01-05 03:21:25 +08:00
.. autoclass :: xgboost.callback.EarlyStopping
:members:
:show-inheritance:
2018-09-07 23:51:26 +03:00
2022-01-05 03:21:25 +08:00
.. autoclass :: xgboost.callback.LearningRateScheduler
:members:
:show-inheritance:
2020-11-12 17:51:32 +08:00
2022-01-05 03:21:25 +08:00
.. autoclass :: xgboost.callback.TrainingCheckPoint
:members:
:show-inheritance:
2019-05-27 13:29:28 +12:00
2019-05-28 16:39:26 +12:00
.. _dask_api:
2019-05-27 13:29:28 +12:00
Dask API
--------
.. automodule :: xgboost.dask
2021-02-09 09:20:58 +08:00
.. autoclass :: xgboost.dask.DaskDMatrix
:members:
:inherited-members:
:show-inheritance:
2019-05-27 13:29:28 +12:00
2022-12-06 00:56:17 +08:00
.. autoclass :: xgboost.dask.DaskQuantileDMatrix
2021-02-09 09:20:58 +08:00
:members:
:inherited-members:
:show-inheritance:
2020-08-05 00:48:10 +08:00
2019-12-23 18:55:32 +08:00
.. autofunction :: xgboost.dask.train
2019-09-25 01:30:14 -04:00
.. autofunction :: xgboost.dask.predict
2019-05-27 13:29:28 +12:00
2020-11-12 17:51:32 +08:00
.. autofunction :: xgboost.dask.inplace_predict
2021-02-09 09:20:58 +08:00
.. autoclass :: xgboost.dask.DaskXGBClassifier
:members:
:inherited-members:
:show-inheritance:
2019-05-28 16:39:26 +12:00
2021-02-09 09:20:58 +08:00
.. autoclass :: xgboost.dask.DaskXGBRegressor
:members:
:inherited-members:
:show-inheritance:
2021-01-13 20:59:20 +08:00
2021-02-09 09:20:58 +08:00
.. autoclass :: xgboost.dask.DaskXGBRanker
:members:
:inherited-members:
:show-inheritance:
2021-01-13 20:59:20 +08:00
2021-02-09 09:20:58 +08:00
.. autoclass :: xgboost.dask.DaskXGBRFRegressor
:members:
:inherited-members:
:show-inheritance:
2021-01-13 20:59:20 +08:00
2021-02-09 09:20:58 +08:00
.. autoclass :: xgboost.dask.DaskXGBRFClassifier
:members:
:inherited-members:
:show-inheritance:
2022-07-17 10:46:09 +08:00
PySpark API
-----------
.. automodule :: xgboost.spark
.. autoclass :: xgboost.spark.SparkXGBClassifier
:members:
:inherited-members:
:show-inheritance:
.. autoclass :: xgboost.spark.SparkXGBClassifierModel
:members:
:inherited-members:
:show-inheritance:
.. autoclass :: xgboost.spark.SparkXGBRegressor
:members:
:inherited-members:
:show-inheritance:
.. autoclass :: xgboost.spark.SparkXGBRegressorModel
:members:
:inherited-members:
:show-inheritance:
2023-01-18 07:52:18 +08:00
.. autoclass :: xgboost.spark.SparkXGBRanker
:members:
:inherited-members:
:show-inheritance:
.. autoclass :: xgboost.spark.SparkXGBRankerModel
:members:
:inherited-members:
:show-inheritance:
2024-11-15 18:23:32 +08:00
Collective
----------
.. automodule :: xgboost.collective
.. autoclass :: xgboost.collective.Config
.. autofunction :: xgboost.collective.init
2025-08-07 18:12:43 +08:00
.. autofunction :: xgboost.collective.finalize
.. autofunction :: xgboost.collective.get_rank
.. autofunction :: xgboost.collective.get_world_size
.. autoclass :: xgboost.collective.CommunicatorContext
2024-11-15 18:23:32 +08:00
.. automodule :: xgboost.tracker
.. autoclass :: xgboost.tracker.RabitTracker