CatBoost
A fast, high-performance gradient boosting library with best-in-class native categorical feature support
Repository Health
Technical Analysis
CatBoost is a gradient boosting on decision trees library developed by Yandex, built to handle categorical features natively without requiring manual one-hot or target encoding. It provides bindings for Python, R, Java, and C++, supports classification, regression, and ranking tasks, and can train on either CPU or GPU with implementations optimized for both.
Beyond raw performance, CatBoost ships with ordered boosting (a technique that reduces prediction shift and overfitting relative to classic gradient boosting), built-in text and embedding feature processing, a monotonic-constraint API, model export to CoreML/ONNX/PMML for production deployment, and interactive visualization tooling (CatBoost Viewer, Jupyter widgets) for monitoring training and understanding feature importance.
What You Get
- A
catboostPython package (CatBoostClassifier,CatBoostRegressor,CatBoostRanker) plus R, Java, and C++ bindings sharing the same core C++ engine - Native categorical and text-feature handling — no manual encoding required for
cat_features/text_featurescolumns - GPU training support (CUDA) alongside a heavily optimized multi-threaded CPU implementation
- Ordered boosting and ordered target statistics to reduce the prediction-shift bias found in classic gradient boosting implementations
- Model export to CoreML, ONNX, PMML, and standalone C++/Python code for deployment outside the training environment
- Built-in visualization tooling — CatBoost Viewer and Jupyter/CatBoost widgets — for tracking training metrics and feature importance interactively
Common Use Cases
- Tabular classification and regression problems with a mix of numerical, categorical, and text columns, where manual feature encoding is a bottleneck
- Ranking and recommendation tasks (search relevance, ad ranking) using CatBoost’s dedicated ranking loss functions
- Kaggle-style competitive ML and industry benchmarking where GBDT accuracy and training speed both matter
- Production ML pipelines that need to export a trained model to ONNX/CoreML/PMML for serving outside Python
Under The Hood
Architecture — CatBoost is a large C++ monorepo (catboost/ directory) with the core boosting engine implemented in C++ under catboost/libs/, and thin language bindings layered on top: a Cython-based Python package (catboost/python-package/catboost/_catboost.pyx) exposing core.py’s CatBoostClassifier/Regressor/Ranker classes, plus separate R and Java (JNI) bindings sharing the same compiled core. Training dispatches to either the CPU or CUDA GPU backend depending on the task_type parameter, with the CPU path built for heavy multi-threading via internal thread pools.
Tech Stack — The core is C++ (compiled via CMake with per-platform CMakeLists.<platform>.txt files for Linux/Windows/macOS/Android across x86/ARM/PPC64, with and without CUDA), wrapped by Cython (.pyx/.pxi files) for the Python API. The build system supports Conan (conanfile.py) for dependency management. The Python package’s pyproject.toml/setup.py orchestrates compiling the C++ core into a wheel per platform.
Code Quality — The repository carries a dedicated catboost_command_style_guide_extension.md and CPP_STYLE_GUIDE.md, and the Python package has a structured ut/ (unit test) directory split into small/medium/large tiers, indicating a deliberate testing tier strategy for a codebase where full-suite runs (GPU training, large datasets) are expensive. Given Yandex’s internal-to-open-source lineage, the C++ core follows house style conventions distinct from typical OSS ML libraries.
API Design — The Python API follows scikit-learn conventions (fit/predict/predict_proba), lowering the learning curve for anyone coming from scikit-learn, XGBoost, or LightGBM, while exposing CatBoost-specific parameters (cat_features, text_features, embedding_features, monotone constraints) as straightforward constructor/fit arguments rather than requiring separate preprocessing pipelines — the core differentiator versus other GBDT libraries that require manual categorical encoding upstream.
Used by 2 apps in this directory
ClearML
Devops · Automation
Auto-magical MLOps platform that tracks experiments, versions data, orchestrates pipelines, and serves models with just two lines of code.
PostgresML
Databases · AI Development
Run ML training and LLM inference natively inside PostgreSQL with GPU acceleration — no data movement required.