XGBoost
XGBoost – eXtreme Gradient Boosting
An optimised gradient boosting trees library, one of the strongest options for tabular data, with GPU and distributed training support.
Basic information
| Name | XGBoost |
|---|---|
| Full name | XGBoost – eXtreme Gradient Boosting |
| Category | Machine Learning Frameworks & Libraries |
| Developer | The DMLC community |
| Release year | 2014 |
| Official website | xgboost.readthedocs.io/en/stable |
| GitHub repository | dmlc/xgboost |
| Official documentation | xgboost.readthedocs.io/en/stable |
| Package on PyPI | xgboost |
| License | Apache-2.0 (PyPI license_expression) |
| Project status | Active Had a release in the last 12 months |
| Latest version | 15 August 2026 (version 3.4.1) |
| Programming language | C++, Python, R, JVM |
| Operating systems | OS Independent (as declared by the package on PyPI) |
| Required Python version | >=3.12 |
| Difficulty level | Medium |
Data last checked: 21 November 2026 — source: PyPI JSON API (2026-11-21)
Overview
XGBoost builds an ensemble of decision trees sequentially, each tree correcting the errors of the previous ones, with regularization, missing-value handling and fast split algorithms, and runs on CPUs and GPUs.
It is widely used in tabular data competitions and in industry, and integrates with scikit-learn through a compatible API and with SHAP to explain decisions.
When to choose it? Choose it for tabular data when you need high accuracy and GPU support; compare LightGBM and CatBoost alongside it.
Uses
Main uses
- Classification and regression on tabular data
- Ranking
- Strong baselines for structured data
Scientific fields
- Finance
- Medicine
- Marketing and industry
Suitable project types
- Risk prediction
- Fraud detection
- Predicting patient readmission
- Predicting patient readmission
Research applications
- Comparing deep models with strong baselines on tabular data
- Comparing deep models with strong baselines on tabular data
Technical features
A feature is shown as "Supported" only if it is documented in the library's official documentation; anything we have not verified is shown as "Not specified".
| CPU support | Supported |
|---|---|
| GPU support | Supported |
| CUDA compatibility | Supported |
| Distributed training or computing | SupportedThrough Dask, Spark and Ray according to the documentation. |
| Automatic differentiation (Autodiff) | Not supported |
| Model deployment | SupportedSaves the model in its own format or JSON, with external conversion tools. |
| Pre-trained models | Not applicable |
| Supported data types | Dense and sparse matrices, pandas tables, categorical features supported |
| Integration with other libraries | Scikit-learn, Pandas, Dask, SHAP, Optuna |
| Flexibility (editorial estimate) | Medium |
| Performance (editorial estimate) | High |
| Community (editorial estimate) | Very large |
| Documentation quality (editorial estimate) | Good documentation |
Installation and running
pip install xgboostCompatibility: Python >=3.12 — according to the package data on PyPI, checked on 21 November 2026
Compatibility: Python >=3.12 — according to the package data on PyPI, checked on 21 November 2026
Installing inside a virtual environment (venv or conda) is recommended. If you need compatibility with a specific CUDA version or operating system, refer to the official documentation, because this information changes with every release.
Code examples
Examples marked "Run and tested" were actually run, with their output, test date and library versions recorded; the others need a GPU or model downloads, so they were not run in the test environment.
MediumXGBoost with early stoppingRun and tested
Goal: Stopping the addition of trees when the validation set stops improving.
import xgboost as xgb
from sklearn.datasets import load_breast_cancer
from sklearn.metrics import roc_auc_score
from sklearn.model_selection import train_test_split
X, y = load_breast_cancer(return_X_y=True)
X_tr, X_va, y_tr, y_va = train_test_split(X, y, test_size=0.25, stratify=y, random_state=0)
model = xgb.XGBClassifier(n_estimators=500, learning_rate=0.05, max_depth=3,
early_stopping_rounds=20, eval_metric="logloss", random_state=0)
model.fit(X_tr, y_tr, eval_set=[(X_va, y_va)], verbose=False)
print("Best number of trees:", model.best_iteration + 1)
print(f"Validation AUC: {roc_auc_score(y_va, model.predict_proba(X_va)[:, 1]):.4f}")
Code explanation
We pass a validation set to fit and set early_stopping_rounds, so training stops after 20 rounds without improvement and the best number of trees is saved in best_iteration.
Output recorded during testing
Best number of trees: 116 Validation AUC: 0.9795
This example was actually run and tested on 21 November 2026 on a CPU — xgboost 3.4.1, scikit-learn 1.9.1, python 3.13.18
Pros
- High accuracy on tabular data
- GPU and distributed training support
- Handles missing values
Limitations
- Many hyperparameters that need tuning
- Less suited to raw images and text
References and verification
- Package page on PyPI (source of the version, licence and release date) Checked directly
https://pypi.org/project/xgboost/
Checked on: 21 November 2026 — version checked: 3.4.1 — reviewed by: the DLArabic team
- Official website A link the package officially declares on PyPI
https://xgboost.readthedocs.io/en/stable/
Checked on: 21 November 2026 — reviewed by: the DLArabic team
- Official documentation A link the package officially declares on PyPI
https://xgboost.readthedocs.io/en/stable/
Checked on: 21 November 2026 — reviewed by: the DLArabic team
- Official repository A link the package officially declares on PyPI
https://github.com/dmlc/xgboost
Checked on: 21 November 2026 — reviewed by: the DLArabic team
- Package page on PyPI (source of the version, licence and release date) Checked directly
https://pypi.org/project/xgboost/
Checked on: 21 November 2026 — version checked: 3.4.1 — reviewed by: the DLArabic team
- Official website A link the package officially declares on PyPI
https://xgboost.readthedocs.io/en/stable/
Checked on: 21 November 2026 — reviewed by: the DLArabic team
- Official documentation A link the package officially declares on PyPI
https://xgboost.readthedocs.io/en/stable/
Checked on: 21 November 2026 — reviewed by: the DLArabic team
- Official repository A link the package officially declares on PyPI
https://github.com/dmlc/xgboost
Checked on: 21 November 2026 — reviewed by: the DLArabic team
History of verified versions
| Version | Release date | Checked on |
|---|---|---|
| 3.4.1 | 15 August 2026 | 21 November 2026 |
Page information last reviewed: 21 November 2026. The description was written originally for the encyclopedia and is not copied from the official websites.
