XGBoost

Scalable, portable gradient boosting library for Python, R, Java, Scala, and C++

Library
PyPI
v3.4.1
28,668stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
98/100Excellent
Development Activity100
Maintenance96
Community96
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
83/100Excellent
Architecture90
Code Quality92
Innovation85
Learning Curve65

XGBoost is an optimized distributed gradient boosting library that implements machine learning algorithms under the Gradient Boosting framework. It provides parallel tree boosting (GBDT/GBM) that solves many data science problems quickly and accurately, and the same code runs on a single machine or scales across distributed environments like Kubernetes, Hadoop, Spark, and Dask.

Widely used in industry and machine learning competitions, XGBoost offers a scikit-learn compatible API alongside its native interface, GPU acceleration, and bindings for Python, R, Java, Scala, and more, making it one of the most battle-tested tools for structured/tabular data modeling.

What You Get

  • A high-performance C++ core with Python, R, Java, Scala, and Julia bindings
  • A scikit-learn compatible API (XGBClassifier, XGBRegressor) alongside the native Booster interface
  • GPU acceleration via CUDA for training and inference
  • Distributed training support across Dask, Spark, and Kubernetes
  • Built-in handling for missing values, feature importance, and monotonic constraints

Common Use Cases

  • Tabular data classification and regression in production ML pipelines
  • Feature importance analysis and interpretable model diagnostics
  • Learning-to-rank models for search and recommendation systems
  • Kaggle-style structured data competitions requiring high predictive accuracy
  • Large-scale distributed training over Spark or Dask clusters

Under The Hood

Architecture - XGBoost’s core is a C++ engine (src/) implementing histogram-based tree construction, gradient statistics, and a pluggable objective/metric system, with the python-package/xgboost directory wrapping it via a C API (_c_api.py) and exposing both a low-level Booster/DMatrix interface (core.py) and a higher-level sklearn.py estimator layer; distributed execution is handled through separate dask/ and spark/ submodules that shard data and coordinate workers via a tracker.py rendezvous server. Tech Stack - The core is C++ built with CMake, with CUDA plugins for GPU histogram building, R and JVM (Java/Scala) bindings compiled from the same native library, and the Python package depending only on NumPy and SciPy at runtime (pandas/scikit-learn/dask are optional extras declared in pyproject.toml). Code Quality - The tests/python directory contains dozens of focused test modules (basic models, callbacks, early stopping, monotone constraints, model I/O compatibility across versions), type hints are enforced via py.typed and mypy in CI, and the codebase uses pylint with documented rule suppressions rather than blanket disabling, indicating deliberate quality gates. API Design - The scikit-learn-compatible estimators (XGBClassifier, XGBRegressor) let users adopt XGBoost with near-zero boilerplate inside existing sklearn pipelines, while the native Booster/DMatrix API offers finer control (custom objectives, GPU device selection, incremental training) at the cost of a steeper learning curve for newcomers unfamiliar with boosting-specific terminology.

Used by 5 apps in this directory

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search